3

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.

Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
  • 1
    I know you couldn't have found it by searching SO, but still a duplicate: http://stackoverflow.com/questions/844241/why-are-c0x-rvalue-reference-not-the-default (I'll give you a +1 for effort and clarity though. :P) –  Feb 22 '10 at 12:04
  • Thank you, hopefully the adjustment to the title will enable someone else to locate the solution. – Hassan Syed Feb 22 '10 at 12:07
  • The problem is symbols are disregarded when searching, so including "&&" doesn't help. You'd have to know the name "rvalue reference" to find SO questions about it. –  Feb 22 '10 at 12:08
  • p.s., if you "google C++ && stackoverlow" this is the first hit. – Hassan Syed Feb 23 '10 at 19:48

1 Answers1

6

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

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

Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
  • it's a bit odd for a library in boost to start using C++0x before it's released. – Hassan Syed Feb 22 '10 at 12:02
  • 5
    @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. –  Feb 22 '10 at 12:06