#include using namespace Shapes; ShapeRep* Square::clone () const { return new Square; } Shape Square::make (std::string request_code) const { Square* ret = new Square; return Shape(*ret); } void Square::draw () const { std::cout << " ______________ \n" << " |/ | \n" << " |// ==== | \n" << " |/// ====| \n" << " |///// | \n" << " |//=== | \n" << " |////======== | \n" << " |/========// | \n" << " |//==/-- | \n" << " L______________J \n" << std:: endl; } Square::~Square() {} namespace { Square& Prototype() { static Square t(Registration("triangle")); return t; } } Shape Shapes::SquarePrototype ( Prototype() );