Boost logo

Boost :

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


El 25/08/2014 2:29, Mostafa escribió:
> I had posted this on the user's list but I think this should be brought
> to the attention of the developers. The following code contains a
> templated copy constructible Boost.Move enabled class (Bar) with a
> single non-copy constructible Boost.Enabled member (Foo). If Bar's copy
> constructor is not explicitly defined then the code compiles with both
> g++ 4.8.2 and VS2005, else if it's explicitly defined then it fails to
> compile on g++ 4.8.2 I think this is due to the fact that g++ 4.8.2
> erroneously instantiates Bar's default copy constructor in the latter
> case. Is this a Boost.Move bug or a gcc bug?

The copy constructor shall not be defined. If the error comes when
returning by value, use BOOST_MOVE_RET:

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

Otherwise, please be a bit more explicit about the error, which
operations, fails, etc.

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.

Best,

Ion


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