Talk:cpp/error/runtime error
From cppreference.com
Wasn't the const char* constructor added in C++11 (not the const std::string& one)? I think this goes for a bunch of the exceptions here on cppreference.com /estan.
[edit] Inconsistency in explanation why std::string&& is not accepted
"Because copying std::runtime_error is not permitted to throw exceptions, this message is typically stored internally as a separately-allocated reference-counted string. This is also why there is no constructor taking std::string&&: it would have to copy the content anyway. "
-> Doesn't the const ref version also need to copy the string away? (BTW, the std::string&& overload could *move* the content away).
217.7.252.169 06:15, 28 February 2020 (PST)