Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost] [Interprocess] Use of Boost.Move in interprocess affecting causing compilation errors with 1.46
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-03-10 09:28:27


El 10/03/2011 7:58, Lars Hagstrom escribió:
> Hi all,
>
> I'm having a problem compiling some code with boost 1.46 that was
> compiling fine with 1.36 to 1.43 (or thereabouts). It appears that this
> is somewhat related to the use of Boost.Move in the Boost.Interprocess
> library.
> I have tried to read up a bit on Boost.Move, but have failed to quite
> understand what of it applies to me.

You are right. The new emulation (which is what Boost.Move will
implement) is more efficient in several cases but forces you to define
the assignment operator. Full explanation here:

http://igaztanaga.drivehq.com/libs/move/doc/html/move/two_emulation_modes.html#move.two_emulation_modes.optimized_mode

> Is this the way it is meant to be? I was fine with the
> compiler-generated ones before...

Yes, it was, but suboptimal for copyable and movable classes like
containers. In the old approach if class A was movable and copyable,
this would call the copy assignment instead of the move assignment

A a (...);
a = A();

...and you could not reuse A()'s string memory in a. If your class
implements copy assignment taking by value, this limitation does not
arise, but value-taking copy assignment is suboptimal for containers.
Sorry for the breaking change.

Best,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net