[C++-sig] Re: return value policy for returning same python object...

David Abrahams dave at boost-consulting.com
Mon Jun 9 00:06:56 CEST 2003


"Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com> writes:

> --- David Abrahams <dave at boost-consulting.com> wrote:
>> David Abrahams <dave at boost-consulting.com> writes:
>> >     const object
>> >     do_iadd (back_reference<Y&> self, int other)
>> >     {
>> >        self.get() += Y_FromInt(other);
>> >        return self.source();
>> >     }
>
> I always thought that returning a const temporary doesn't make sense. Do you
> mean "const object&" above? 

No, that would be a disaster (return a reference to a local object).
Actually, I just meant "object".

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list