A said:
Firstly, i would like to point out that a default copy constructor is just
another name for the implicitly defined copy constructor that is created for
you when you do not explicitly specify one yourself.
It seems that I have confused a few people with my inaccurate statement, so
I will make the following amendments:
A default copy constructor is created for you when you don't specify one
yourself. In such case, the default copy constructor will simply do a
bitwise copy for primitives (including pointers) and for objects types call
their copy constructor. If in the later case, a copy constructor is not
explicitly defined then, in turn, a default copy constructor will be
implicitly created.
I believe this is ROCK SOLID now!
not really.
It is not consistent with the use of the word 'default' in conjunction
with the word 'constructor'.
A default constructor is a constructor which can be called without
specifying arguments.
Thus
C::C(); is a default constructor
C::C( int i = 0 ); is a default constructor
C::C( in j ); is *not* a default constructor, because it can only
be used if some argument is specified.
So the meaning of 'default' in the context of constructors has nothing to do
with who created the function, either the programmer or the compiler. It has
to do with beeing able to be called without arguments.
That's why there is no 'default copy constructor', because a copy constructor
per definition has to be called with an argument: the object to make a copy from.
Also: replace the action a compiler generated copy constructor does with:
... the compiler generated copy constructor does a member wise copy of
its members. For builtin types (including pointers) this means a bitwise
copy. For other types the copy constructor of the member is used.
It is not the constructor which decides how this copy should be done. It
is the member which decides this.
Drop the last sentence ( "If in the later case, .... " ), it is not needed
and follows from the beginning of your paragraph ( "A default copy constructor
is cretaed for you when ..." ).
The compiler will always generate a cctor if none is specified, if it
needs one. This does include but is not restricted to: if used in another
constructor.