Boost logo

Boost :

Subject: Re: [boost] Temporary objects
From: DE (satan66613_at_[hidden])
Date: 2009-10-30 15:57:52


on 30.10.2009 at 12:57
 Thomas Klimpel wrote :
>> template<typename type>
>> class temporary : public type
> This is actually an interesting semantic. I just checked and found
> that the proposed Boost.Move library also uses the same semantics (move.hpp:72-73:
> template <class T>
> class rv : public T
> ), but the older Adobe Move library doesn't use it, and the
> semantics of the proposed rvalue-reference is also different from this.

> What I like about this semantics is that for

> class A {...};
> class B : public A {...};

> the type "temporary<B>&" cannot implicitly be converted to
> "temporary<A>&". For the proposed rvalue-reference, the type "B&&"
> can implicitly be converted to "A&&", and I have the impression that
> this can lead to behavior even worse than slicing.
very good point
i didn't think about it

well, i'd try to rephrase this issue:
for D derived from B does swap(A, B) implements the right semantics
and what is that "right semantics"?
but this looks like off topic so far

-- 
Pavel

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