This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: C++ : Creating Object by parameter with call of function
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Kristian Kratzenstein <kristian dot kratzenstein at kielnet dot net>, gcc-help at gcc dot gnu dot org
- Date: Tue, 26 Apr 2005 13:18:28 -0500
- Subject: Re: C++ : Creating Object by parameter with call of function
- References: <1114528827.29413.ezmlm@gcc.gnu.org><fc.0000000100012ea33b9aca00ad4be362.12ed8@KielNet.net>
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