Boost logo

Boost :

Subject: Re: [boost] [variant] Why no move emulation with Boost.Move for C++03?
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-04-14 08:49:12


Hi,

Ion Gaztañaga wrote:
> El 13/04/2014 14:59, Steven Watanabe escribió:
>> AMDG
>>
>> On 04/12/2014 02:33 PM, Andrzej Krzemienski wrote:
>>> Hi,
>>> I am trying to figure out what the best way to enable move semantics in
>>> Boost.Optional. I tried to pick at how Boost.Variant does it. If I
>>> understand correctly, move operations are only defined if compiler
>>> supports
>>> rvalue references. I wonder why it doesn't use Boost.Move, which would
>>> enable move semantics even for compilers w/o rvalue references. Is
>>> there
>>> any reason for this (that I should also take into account for
>>> Boost.Optional)?
>>>
>>
>> Boost.Move is not completely backwards
>> compatible. i.e. adding it to an existing
>> class can break user code.
>
> If the assignment operator is a major problem, we can define another
> alternative that can be less efficient in some contexts but maintain
> assignment operator intact.

With a "standard" copy assignment? Btw, I proposed to do this for Tuples
some time ago - https://svn.boost.org/trac/boost/ticket/7276.

Regards,
Adam


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