xmllmx
xmllmx

Reputation: 42215

Why not make { "hello"s + "world"sv; } valid in C++20?

#include <string>
#include <string_view>

using namespace std::literals;

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

See online demo

Why not make "hello"s + "world"sv valid in C++20?

Upvotes: 0

Views: 119

Answers (0)

Related Questions