Boost logo

Boost :

Subject: Re: [boost] [variant] Why no move emulation with Boost.Move for C++03?
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2014-04-14 05:09:03

2014-04-14 10:53 GMT+02:00 Krzysztof Czainski <1czajnik_at_[hidden]>:

> Main restriction that affect portability is described here:
>> "Assignment
>> operator in classes derived from or holding copyable and
>> movable types")
>> It is a big problem. For example this limitation broke compilation of
>> Boost.ProgramOptions after move emulation was added to Boost.Any:
>> Because of that restriction Boost.Variant, Boost.Any and
>> Boost.CircularBuffer do not use Boost.Move emulation everywhere. For those
>> libraries some of the move functions are available only in C++11 mode.
> I think with an assignment operator implemented in terms of the
> pass-by-value and swap idiom, you get a CopyAssignamble as well as a
> MoveAssignable type without this issue. I described this here [1] together
> with my 'explicit copy' proposition.

I don't think this approach is acceptable for in-place containers like
optional or variant, where the swap operation isn't just a simple pointer


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