Cpp of Head First Design Pattern