type something{ public: something; //default +or something( const something& cloneMe ){ this->abc = cloneMe.abc }// something( const int& setThisAttribute ){ this->abc=setThisAttribute; } //records int abc; }; //so... something x; //makes use of the default +or to create x something y(x); //makes use of your replica +or to create a y this is a in basic terms like x something z(777); //makes use of the parametrized +or to set some value up in z
?
2011-05-18 22:31:09 UTC
I found this article interesting. This might be the answer to your question:
Yes. A copy constructor for class T is, by definition (12.8[class.copy]/2 in the standard), a non-template constructor with a first parameter of type T& or of type const T& or of type volatile T& or of type const volatile T&. If it has more than one parameter, all other parameters must have default values.
This means that the following class has four overloaded copy-constructors: