Questions tagged [ref-qualifier]

A way to specify the value category of the *this pointer in a member function.

47 questions
0
votes
2 answers

Is there a use-case for std::string's operator= to not be lvalue ref-qualified?

The post here points out that std::string's member operator= is not lvalue ref-qualified. That allows us to write code such as this: std::string() = "Hello"; The linked post asks why this is allowed. The answer is backwards compatibility: Changing…
user589321
  • 99
  • 6
0
votes
2 answers

error of template instantiation of ref-qualified members

#include using std::cout; template class A{ public: template void f(U const&) & ; template void f(U const&) && ; }; template template void A::f(U const&…
1 2 3
4