奇数C++成员函数声明语法:&&限定符

Has*_*yed 3 c++ boost-thread

来自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);
...
}
Run Code Online (Sandbox Code Playgroud)

究竟是那些双括号?我浏览了"BS C++ Langauge 3d版"并找不到任何解释.

ken*_*ytm 6

这是rvalue引用的C++ 0x附加.

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

  • @Hassan:不,不是.在标准化之前对功能进行实验要好得多(标准的主要目标之一是"标准化现有实践"),这种实验是提升的主要目标.实际的boost实现使用预处理器有选择地启用rvalue refs. (5认同)