#include #include using namespace Shapes; Shape::Shape() : Rep(0){} Shape::Shape(const Shape& e) { if (e.Rep) Rep = e.Rep->clone(); else Rep = 0; } Shape::Shape(ShapeRep& r) { Rep = r.clone(); } Shape& Shape::operator= (const Shape& e) { if ( &e != this ) { delete Rep; Rep = e.Rep->clone(); } return *this; } Shape::~Shape() { delete Rep; } ShapeRep* Shape::operator->() { return Rep; } std::list& Shapes::PrototypeList() { static std::list x; return x; }