Anarki Anarki - 1 year ago 188
C++ Question

C++ Double Address Operator? (&&)

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

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

Does "Address of Address" make any sense? Why does it have two address operators instead of just one? Thanks.

Answer Source

This is C++11 code. In C++11, the && token can be used to mean an "rvalue reference".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download