我有一个小程序可以编译,GCC但不能在MSVC哪个编译器上不遵循constexpr string_view比较标准?
#include <iostream>
#include <string_view>
int main(int argc, char **argv) {
const constexpr auto a = "z";
const constexpr std::string_view test("z",1);
const constexpr std::string_view test2(a,1);
if constexpr(test == test2) {
return 5;
}
else{
return 2;
}
}