python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
C++ user-defined conversions, ref-qualifiers and overload resolution
Please, help me understand what's wrong with this piece of code:
#include <string>
#include <utility>
class Sample
{
public:
explicit Sample(std::string data):
_data(std::move...
Yurii A
Votes: 0
Answers: 0
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 i...
user589321
Votes: 0
Answers: 2