[C++-sig] Re: return_internal_ref trouble (gcc341)

David Abrahams dave at boost-consulting.com
Wed Sep 22 22:51:19 CEST 2004


"Neal D. Becker" <ndbecker2 at verizon.net> writes:

> This is the first time I tried return_internal_reference.  I noticed that in
> gcc-3.4.1, complex has been changed so that real() and imag() return a ref
> (or const ref).  Hurray!  But then what's wrong here:

Basically return_internal_reference only works when the referenced
type is a wrapped class.  Why not just return them by value?

  x.real() = 3 

can't work in Python anyhow.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com




More information about the Cplusplus-sig mailing list