This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: non-const copy ctor


Hi John,

John Love-Jensen wrote:
> [...]
> In C++, a copy constructor is a const reference.

Hmm, I would say *usually* it is a const reference.-- But eventually it is 
not, like in my case or in the case of std::auto_ptr. Of course you could say 
this isn't a copy constructor because it doesn't take a const reference. But 
I think it is anyway because it still has the semantic of a copy operation.

Anyway, I need to have a constructor taking a non-const reference which g++ 
doesn't allow. And I still don't know why g++ is acting this way here and how 
to work around it.

Yours,
  Christian

> [...]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]