Why doesn't make_pair<string, string>() call the copy contructor, when given const string&?
Both GCC and Clang refuse to compile this one: #include <string> #include <utility> using namespace std; int main() { const string s = "12345"; const string& r = s; auto p = std::make_pair<string, string>(r, r); } GCC says: error: cannot bind rvalue reference of type ‘std::__cxx11::basic_string<char>&&’ to lvalue of type ‘const std::string’ {aka ‘const std::__cxx11::basic_string<char>’}… Read More Why doesn't make_pair<string, string>() call the copy contructor, when given const string&?