Thursday, October 14, 2010

Copy Constructors

The following is a declaration of a copy constructor:
   A(const A& a, int i = 0);

If you also declare A(const A& a), you will get a compiler error.

Reference: More Exceptional C++ by Herb Sutter. Addison-Wesley, 2002, p. 107.

No comments:

Post a Comment