C++ : Creating Object by parameter with call of function

Eljay Love-Jensen eljay@adobe.com
Tue Apr 26 18:17:00 GMT 2005


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



More information about the Gcc-help mailing list