Hey
So i have been tinkering alot with the features of C++17 and i think there are some really nice things that have been added.
But i ran into a problem.
template< class T >
void test() {
if constexpr( std::is_void_v<T> ) {
T * t;
} else {
T t;
}
}
int main() {
test< void >();
return 0;
}
Here i expect the compiler to tell me everything is ok and simply skip the else branch.
Since i never call the function "test" with something that isnt a void.
I assume i would only reach the point "T *t".
But thats not the case, im using the very latest version of Visual Studio, 15.5.5.
I have in my project enabled the C++17 language standard and also enabled the conformance mode (/permissive-)
Yet Visual Studio is telling me "illegal use of type 'void'" which of course is correct if i ever where to reach that branch.
Am i just not understanding how its supposed to work?
Any help would be greatly appreciated