C++ Double Address Operator? (&&)

I’m reading STL source code and I have no idea what && address operator is supposed to do. Here is a code example from stl_vector.h:

vector&
operator=(vector&& __x) // <-- Note double ampersands here
{
    // NB: DR 675.
    this->clear();
    this->swap(__x); 
    return *this;
}

Does “Address of Address” make any sense? Why does it have two address operators instead of just one?

6 Answers
6

Leave a Comment