Boost logo

Boost :

Subject: Re: [boost] [move] pre-review comments
From: Jeffrey Lee Hellrung, Jr. (jhellrung_at_[hidden])
Date: 2010-04-05 14:46:11


Ion Gaztañaga wrote:
> El 05/04/2010 7:22, Jeffrey Lee Hellrung, Jr. escribió:
>> Ion Gaztañaga wrote:
>>> El 03/04/2010 20:03, Jeffrey Lee Hellrung, Jr. escribió:
>>>> template< class T >
>>>> struct my_vector
>>>> {
>>>> void push_back(T& x) { /* copy x */ }
>>>> void push_back(const rv<T>& x) { /* copy x */ }
>>>> void push_back(rv<T>& x) { /* move x */ }
>>>> };
>>>
>>> I use a similar trick in current interprocess containers, which use
>>> the other version of the move emulation (the one that does not kick
>>> move-assignment for rvalues of copyable types. See push_back here:
>>>
>>> http://www.boost.org/doc/libs/1_42_0/boost/interprocess/containers/container/vector.hpp
>>>
>>
>>
>> Do you think this technique is worth formalizing?
>
> Interesting if it can simplify code writing for class designers, but it
> should be quite lightweight, I wouldn't like to maintain the move
> library simple.

"...I wouldn't like to maintain the move library simple."

Come again?

- Jeff


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