class compound : public shape { 
\ifsli{}{\fbox{compound}}
public: compound( shape* s = 0 ) : fig(s) { next = 0; } void add( shape* s ) { if (next) next->add(s); else next = new compound(s); } void move(int x, int y) { if (fig) fig->move(x,y); if (next) next->move(x,y); } void draw() { if (fig) fig->draw(); if (next) next->draw(); } private: shape* fig; compound* next; };

slide: Compound shapes