Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-02-09 11:33:20

Peter Dimov wrote:
> Howard Hinnant wrote:
>> Reasoning:
>> foo(A());
>> expands to:
>> foo(A(A()));
> No, it expands to
> typedef A const CA;
> foo(CA(A()));
> The difference is that a const_cast<A&> inside foo is now undefined
> behavior (whereas a direct binding would've made it legal.)

However (apologies for the follow up to self) the rest of Howard's analysis
still seems to apply, i.e. the CA temporary is created with A::A(A&&), and
the A const & parameter of foo is bound directly to that temporary (if not

Boost list run by bdawes at, gregod at, cpdaniel at, john at