Boost logo

Boost :

Subject: Re: [boost] [variant] Basic rvalue and C++11 features support
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-11-02 12:01:31


on Fri Nov 02 2012, paul Fultz <pfultz2-AT-yahoo.com> wrote:

> ----- Original Message -----
>> From: Dave Abrahams <dave_at_[hidden]>
>> To: boost_at_[hidden]
>> Cc:
>> Sent: Thursday, November 1, 2012 2:53 PM
>> Subject: Re: [boost] [variant] Basic rvalue and C++11 features support
>
>>
>>
>> on Thu Nov 01 2012, "Vicente J. Botet Escriba"
>> <vicente.botet-AT-wanadoo.fr> wrote:
>>
>>> Le 01/11/12 18:57, Antony Polukhin a écrit :
>>>> Hi,
>>>>
>>>> There is a patch in ticket #7620 that adds some rvalue assignment
>>>> operators and rvalue constructors for Boost.Variant library.
>>>>
>>>> I saw no activity from authors of Boost.Variant Eric Friedman and Itay
>>>> Maman for a long time, so if there will be no objections, I'll
>> commit
>>>> patch to trunk in the middle of November.
>>>>
>>>> Any suggestions and comments are welcomed.
>>>>
>>>>
>>> Hi,
>>>
>>> I have not analyzed completely the patch but I see that Boost.Move is
>>> not used to emulate move semantics on C++98. Is there a deep reason to
>>> don't use it?
>>
>> +1
>> See https://svn.boost.org/trac/boost/ticket/7601
>
> Interesting, as this will compile:
>
> struct foo
> {
>     foo() {}
>     boost::variant<int, float> x;
> };
>
> int main()
> {
>     foo a;
>     a = foo();
> }
>
> But if it were to use Boost.Move, this will no longer compile,
> breaking barkwards compatibility.

Oh, *that* old problem again! I agree that it's searious. I guess
Boost.Move is not-very-usable in that case. I wonder if Boost.Move
could use whatever technique boost::variant does?

-- 
Dave Abrahams
BoostPro Computing                  Software Development        Training
http://www.boostpro.com             Clang/LLVM/EDG Compilers  C++  Boost

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