I'm sorry I couldn't come with a better title.
What the last ampersand &
means in the following code snippet:
A & A::operator=(A rhs) &
{
swap(*this, rhs);
return *this;
}
Depending on the answer I would like to know if:
- it makes sense only for
operator=
or can also be applied to any function - it is a new C++11 feature or if it already exists in C++98/03
If you need more context, I found this syntax here: https://stackoverflow.com/a/12653520/951426
There is a small explanation but I don't understand.
Edit (formatting and short answer to my questions):
- it's not specific to
operator=
- it is a new C++11 feature necessary due to the new rvalues