是否有任何特殊原因导致operator+
和std::string
未定义std::string_view
?我觉得这很奇怪。
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std::literals;
int main()
{
// That's OK
std::cout << "Hello,"s + " World!" << std::endl;
// Here at least GCC complains
std::cout << "Hello, "s + " World!"sv << std::endl;
}