Next: , Previous: Solid Data Members, Up: Solid Reference


34.2 Constructors and Setting Functions

— Default constructor: void Solid (void)

Creates an empty Solid.

— Copy constructor: void Solid (const Solid& s)

Creates a new Solid and makes it a copy of s.

— Template specializations: Solid* create_new<Solid> (const Solid* s)
— : Solid* create_new<Solid> (const Solid& s)

Pseudo-constructors for dynamic allocation of Solids. They create a Solid on the free store and allocate memory for it using new(Solid). They return a pointer to the new Solid.

If s is a non-zero pointer or a reference, the new Solid will be a copy of s. If the new object is not meant to be a copy of an existing one, ‘0’ must be passed to create_new<Solid>() as its argument. See Dynamic Allocation of Shapes, for more information.