Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-10-24 12:02:03


Daniel Frey <daniel.frey_at_[hidden]> writes:

> Marc Duflot wrote:
> >
> > g++ 2.95.2
> > g++ 3.0.4
> > g++ 3.1 and 3.2
> > Intel C++ 6.0
> > SGI MipsPro Compiler
> > Visual C++ 6
>
> Thanks for testing :))
>
> > Summary:
> > * g++ 3.0.4: bad
> > * g++ 2.95.2 and Visual C++ 6: average: RVO but not NRVO
> > * Intel C++ 6.0 and SGI MipsPro Compiler (both based on EDG): good: RVO and
> > NRVO except with X x( f() );
>
> The question is, why 'X x( f() );' is different from 'X x = f();'.

I remember having this conversation with the EDG guys last year. For
people whose heads are deep in the core language, apparently it isn't
obvious that they should be the same, and that it won't be obvious to
users which form avoids the extra copy.

-- 
                    David Abrahams
dave_at_[hidden] * http://www.boost-consulting.com
Building C/C++ Extensions for Python: Dec 9-11, Austin, TX
http://www.enthought.com/training/building_extensions.html

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk