[Next] [Prev] [Up] [Top]

7.0 Classes

Canonical Class Form (GL)


Most classes should at least declare (but not necessarily define) the following methods: default constructor, copy constructor, assignment operator, and destructor.

To protect against the compiler providing default definitions, for all but the destructor, you can put a declaration in the protected (or private) section of the class header, but not give any definition in the implementation file.

class X

{

X (); // default constructor

X (const X& x); // copy constructor

X& operator = (const X& x); // operator equal

virtual ~X (); // destructor

};


No Title
[Next] [Prev] [Up] [Top]

Generated with CERN WebMaker

This site was grabbed using the TRIAL version of Grab-a-Site. This message does not appear on a licensed copy of Grab-a-Site.