I am trying to compile this code with gcc and clang:
#include <iostream>
#include <type_traits>
template<int N>
struct Test
{
template<typename = std::enable_if_t<N == 1, bool>>
void func()
{
std::cout << "Test::func"<< std::endl;
}
};
int main()
{
Test<0> t;
//t.func();
}
So, I have an error:
error: no type named 'type' in 'std::__1::enable_if<false, bool>'; 'enable_if' cannot be used to
disable this declaration
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
But if I compile that code with vc++ there is no error. So, which compiler resolves this issue according to c++ standard?