Next: , Previous: Shape Operators, Up: Shape Reference


18.3 Copying

const pure virtual function: Shape* get_copy (void)

Copies an object, allocating memory on the free store for the copy, and returns a pointer to Shape for accessing the copy.

Used in the drawing and filling functions for copying the Shape, and putting a pointer to the copy onto the vector<Shape*> shapes of the Picture.