I need to call a templated conversion operator inside a class like this :
struct S {
template<typename T>
operator T() const {
return T{};
}
template<typename T>
T test()
{
return operator T();
}
};
int main(){
S s;
s.test<int>();
return 0;
}
This code compiles with clang but not with MSVC(19), gives me a c2352 error. Is the correct syntax?