From: Rani Sharoni (rani_sharoni_at_[hidden])
Date: 2004-02-07 06:23:32


Raoul Gough wrote:
> struct A { A &as_lvalue () { return *this; } };
>
> void foo (A const &);
>
> void bar () {
> foo (A()); // #1 Can copy
> foo (A().as_lvalue()); // #2 Can't copy
> }

Lately we discovered that there is difference between #1 and #2 since #1
might produce a const object, since in case that additional temporary is
introduced it is const, with all the following consequences (e.g. potential
const optimizations that no compiler actually do).

Rani