0
#include <string>
#include <string_view>

using namespace std::literals;

int main()
{
    "hello"s + "world";   // ok
    "hello"s + "world"sv; // error
}

见在线演示

为什么不在 "hello"s + "world"sv C++20 中有效?

4

0 回答 0