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: C++ : Creating Object by parameter with call of function


Hi Kristian,

Can you change the signature of the one dclass constructor to...
dclass(dclass const&)
...?

That would allow temporaries to be passed to the constructor without the compiler complaining that you are passing a temporary to a function (i.e., the constructor) which indicates that it intends to change/mutate the passed-in reference object because you don't have the const qualifier on the reference.

HTH,
--Eljay


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