Boost logo

Boost :

Subject: Re: [boost] Movable but not copyable bug?
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2014-08-25 17:01:18


El 25/08/2014 18:08, Mostafa escribió:
> On Mon, 25 Aug 2014 03:23:59 -0700, Ion Gaztañaga <igaztanaga_at_[hidden]>
> wrote:
>
> [snip]
>
>> I also noted that you've disabled the assignment operator taking by
>> value. I have no idea on what can happen, as Boost.Move disables also
>> the copy assignment taking by non-const reference.
>
> Does that mean that when using BOOST_MOVABLE_BUT_NOT_COPYABLE clients
> should not delete the copy constructor or the copy assignment operator?
> If so, that should be documented.

I think it's documented:

http://www.boost.org/doc/libs/1_56_0/doc/html/move/movable_only_classes.html

http://www.boost.org/doc/libs/1_56_0/doc/html/BOOST_MOVABLE_BUT_NOT_COPYABLE.html

> Also, can BOOST_COPYABLE_AND_MOVABLE be used with the copy-and-swap idiom?

I haven't tried, but I think it will work. Try avoiding a
BOOST_COPY_ASSIGN-based assignment shown here

http://www.boost.org/doc/libs/1_56_0/doc/html/move/implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp03

and define your assignment taking by value.

I hope it helps,

Ion


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