我正在阅读STL源代码,我不知道&&应该使用哪个地址运算符。这是来自的代码示例stl_vector.h:
vector&
operator=(vector&& __x) // <-- Note double ampersands here
{
// NB: DR 675.
this->clear();
this->swap(__x);
return *this;
}
“地址地址”有意义吗?为什么它有两个地址运算符而不是一个?
&,它也与address-of运算符无关,而是表示这__x是一个引用。