Boost logo

Boost :

Subject: Re: [boost] [move] Unifying move emulation code in boost
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-01-06 07:22:23

David Abrahams wrote:

>> MovableOnly factory();
>> int main()
>> {
>> MovableOnly m1(factory());
>> MovableOnly m2(MovableOnly(arg));
>> return 0;
>> }
>> Maybe I'm doing something wrong but I just gave up after several tries to fix this ;-)
> Have you got the code and tests in the sandbox? I will be happy to take
> a crack at it.

Agggghhhhhh!!! I've lost several hours until I realized that emulation
code (and my own first example) does NOT disable copy constructor taking
a const reference!!

//Movable only type does this(like unique_ptr)

unique_ptr(unique_ptr &);
unique_ptr &operator=(unique_ptr &);

instead of

unique_ptr(const unique_ptr &);
unique_ptr &operator=(const unique_ptr &);

Sometimes I feel really stupid ;-)

Sorry for the noise,


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