views:

179

answers:

1

From Boost::Thread:

template <typename R>
class shared_future
{
...
// move support
shared_future(shared_future && other);
shared_future(unique_future<R> && other);
shared_future& operator=(shared_future && other);
shared_future& operator=(unique_future<R> && other);
...
}

What on earth are those double-ampersands ? I went over "BS The C++ Langauge 3d edition" and couldn't find any explanation.

+6  A: 

This is a C++0x addition for rvalue references.

See http://www.artima.com/cppsource/rvalue.html.

KennyTM
it's a bit odd for a library in boost to start using C++0x before it's released.
Hassan Syed
@Hassan: No, it's not. It's much better to experiment with features before they're standardized (one of the main goals of the standard is to "standardize existing practice"), and such experimentation is a main goal of boost. The actual boost implementation uses the preprocessor to selectively enable use of rvalue refs.
Roger Pate