Since a string literal is considered an lvalue, why must the binding lvalue reference be const?
问题 I know there are topics that are similar to this one already (such as this). The example given in this topic was this: std::string & rs1 = std::string(); Clearly, that std::string() is an rvalue. However, my question is why is s1 legal while s2 is not? const std::string& s1 = "String literal"; std::string& s2 = "String literal"; The standard clearly states that string literals are lvalues (which is understandable since they are technically const char* behind the scenes). When I compile s2