Boost logo

Boost :

Subject: Re: [boost] [move] Unifying move emulation code in boost
From: Daniel James (daniel_james_at_[hidden])
Date: 2009-01-05 07:00:44


2009/1/4 Ion Gaztañaga <igaztanaga_at_[hidden]>:
>
> Howard's unique_ptr contribution has shown again the need for a unified move
> emulation in Boost. We already have move emulation at least in 5 libraries:

In the move library I was working on, I wasn't aiming for unified move
emulation, instead it's meant to be flexible enough to support
different move implementations. This would still be important when
using libraries outside of boost, as they can't be expected to use our
implementation.

> -> Unordered: based on Adobe's move library. It's more advanced than the
> previous one, but Adobe's own library says
> (http://stlab.adobe.com/group__move__related.html) that a Movable type must
> satisfy the requirements of concept Regular, which has copy constructor
> (thus disabling move-only types!). I don't know if the move emulation itself
> uses Regular requirements.

Move only types are possible (see the attached example, it uses the
library at http://svn.boost.org/svn/boost/sandbox/move, although I
haven't updated the documentation yet. it's a similar technique to
thread's). There is a problem - it doesn't support taking a const
reference to a returned noncopyable type. I think your unique_ptr
deals with this case correctly, but it is more complicated to
implement. If it could be made easy that would be ideal.

I'm probably not going to have any time to work on this in the near
future, as I've got a few website and documentation tasks to do before
the next release. I naively assumed that all I'd need to do was
boostify the adobe library, but it ended up being a larger task. So if
you want to take it on or do something different feel free.

Daniel


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