Following code (also attached) compiles fine with clang gcc but fails with an error with icc.
#include <iostream>
struct MyIndex : std::integral_constant<int, -1> {};
struct Dimension {
using Dynamic = MyIndex;
};
template<class T, T Key>
constexpr bool make_true2(const std::integral_constant<T, Key>&)
{
return 1;
}
template<int I>
constexpr int make_true() {
return make_true2(Dimension::Dynamic());
}
template<
int I
, typename std::enable_if<make_true<I>(), int>::type = 0
>
int myfunc() {
return 9;
}
int main() {
std::cout << myfunc<0>() << std::endl;
return 0;
}