FAQ 30.02 What are the Big Three?

Destructor, copy constructor, and assignment operator.

These infrastructure routines provide the death and copy semantics for objects of the class. Here is some sample syntax:

 class Fred { public:   ~Fred() throw();                          // Destructor   Fred(const Fred& x) throw();              // Copy Constructor   Fred& operator= (const Fred& x) throw();  // Assignment Operator }; Fred::~Fred() throw() { /*...*/ } Fred::Fred(const Fred& x) throw() { /*...*/ } Fred& Fred::operator= (const Fred& x) throw() {   // ...   return *this; } 


C++ FAQs
C Programming FAQs: Frequently Asked Questions
ISBN: 0201845199
EAN: 2147483647
Year: 2005
Pages: 566
Authors: Steve Summit

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net