template<bool F, typename = std::enable_if_t<F>>
auto func1() -> int { return 0; }
template<bool F, typename = std::enable_if_t<!F>>
auto func1() -> int { return 0; }
template<bool F, std::enable_if_t<F, int> = 0>
auto func2() -> int { return 0; }
template<bool F, std::enable_if_t<!F, int> = 0>
auto func2() -> int { return 0; }
Here are two sets of overloaded functions: func1() and func2().
func1() uses type parameter for SFINAE and func2() uses non-type parameter for SFINAE.
When compiling these functions, func1() causes compilation error but func2() does not. Why does SFINAE work for func2() and fails for func1()?