string_view 的 C++17 运算符“”?

C++17 operator""s for string_view?

C++17 会包含用于 const char*std::string_view 转换的文字后缀吗?

auto str = "asdf"s;

上面语句中str的类型会是std::string还是std::string_view

如果我们相信 STL's comment, then yes, we'll have string view literal suffixes based on, I believe, P0403R0

如果我理解正确,s 将保留 std::string 文字后缀,而 std::string_view 将使用 sv.

cout << "Hello, string_view literals!"sv << endl;
cout << "Hello, string literals!"s << endl;

截至 this commit sv 在标准 C++ 草案中。