"Terje Sletteb�" <[EMAIL PROTECTED]> writes:
>>From: "Gennaro Prota" <[EMAIL PROTECTED]>
>
>>On Sat, 9 Nov 2002 17:14:49 +0100, "Terje Sletteb�"
>><[EMAIL PROTECTED]> wrote:
>
>>> In any case, the
>>>program below detects presence of NRVO, by returning zero, or greater than
>>>zero if NRVO is not present.
>
>>Actually it shows whether that optimization is applied in a specific
>>example.
>
> True. But it's better than nothing. :) Intel C++ applied the NRVO, even with
> all optimisations turned off. In the same way, MSVC 6 did not, regardless of
> settings.
I suspect that you'll find this to be the case on most compilers. The
RVO doesn't fall into the category of back-end or
intermediate-language optimizations that compilers usually let you
turn on and off. It has to happen in the front-end, since it often
implies observable differences in the code's behavior.
--
David Abrahams
[EMAIL PROTECTED] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost