Boost logo

Boost :

Subject: [boost] move library / trait needed (was: [move] New version with move-aware containers library)
From: David Abrahams (dave_at_[hidden])
Date: 2009-04-30 13:27:03


on Sun Apr 12 2009, Ion Gaztañaga <igaztanaga-AT-gmail.com> wrote:

> Hi to all,
>
> Sorry for the delay, but finally I've found some time to uploaded a new version of
> Boost.Move:
>
> Sandbox:
>
> https://svn.boost.org/trac/boost/browser/sandbox/move
>
> ZIP file with docs:
>
> http://www.drivehq.com/web/igaztanaga/move.zip
>
> Online docs:
>
> http://www.drivehq.com/web/igaztanaga/libs/move/

Hi Ion,

are you familiar with
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2855.html
?

Until the committee decides exactly how to handle it and compilers catch
up with the feature they add, we need a workaround for that problem,
both for C++03 and C++0x. The simplest approach requires a trait called
has_nothrow_move<T> which can be used to SFINAE-out pair's move
constructor unless its members all have a nonthrowing move constructor.
It would be reasonable to say

   template <class T>
   struct has_nothrow_move : has_move_constructor {};

as a default, since move constructors shouldn't throw. But still, we
need an implementation of has_move_constructor. Obviously, that will
require compiler support to be optimal, but in the meantime it can be
specialized.

Now, the rub: I'd like to have has_nothrow_move in place in the Boost
SVN by the time BoostCon starts (Monday), so we can use it for
http://www.boostcon.com/program/sessions#abrahams-boost0x-1-hands-on-rvalue-references

What do you think; can we get this integrated with your library and
checked in? I think we'll all be doing our BoostCon work on a branch
anyway, so it's reasonable to consider just checking the move
constructor stuff in on a branch of the Boost trunk.

Thanks,

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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