Home

I thought the copy ctor always takes the form
Test::Test(const Test & arg);
for a class Test.

But I read the following sentence in Stanley Lippman's C++ Primer 4th
Edition(Page 476):

The copy constructor is a special constructor that has a single
parameter that is a (usually const) reference to the class type.

My doubt
--------------
Since the above sentence contains "(usually const)" in parantheses,
does it mean that we may need a copy ctor that takes the form
Test::Test(Test & arg) ?
(that is, reference to plain type) ?

Kindly let me know when we will need this second form.

Thanks
V.Subramanian

previous
next

Re: How bool data type is implemented in C++
Re: generating list of sub lists
Re: So what exactly is a complex number?
Re: enum
Re: File Input/Output
Niechciane i Zapomniane
Fundacja Sloneczko
Mam Marzenie
Fundacja Hobbit
Akogo