Head First Design Pattern (c++)