我不明白为什么这段代码编译没有错误:
#include <iostream>
template <class T>
struct Test
{
static constexpr T f() {return T();}
};
int main()
{
Test<void> test;
test.f(); // Why not an error?
return 0;
}
Run Code Online (Sandbox Code Playgroud)
根据标准是否可以,还是编译器容差?