error: no viable conversion from 'std::string_view' (aka 'basic_string_view<char>') to 'std::string' (aka 'basic_string<char>')
[build] std::string ss = sv;
[build] ^ ~~
[build] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/string:845:33: note: candidate constructor not viable: no known conversion from 'std::string_view' (aka 'basic_string_view<char>') to 'const string &' for 1st argument
[build] _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const basic_string& __str);
[build] ^
试了试,报错了啊
clang可以,有Wconversion
【 在 speedboy2998 的大作中提到: 】
: 这玩意儿最大的坑在于
: std::string_view sv;
: std::string ss = sv;
: ...................
--
修改:gfkid FROM 114.249.22.*
FROM 114.249.22.*