Maybe I\'m tired, but I\'m stuck with this simple partial specialization, which doesn\'t work because non-type template argument specializes a template parameter with
Solution using Yakk's solution:
#include
#include
template
struct X {
static const bool isZero = false;
};
template
struct X < T, N, typename std::enable_if::type > {
static const bool isZero = true;
};
int main(int argc, char* argv[]) {
std::cout << X ::isZero << std::endl;
std::cout << X ::isZero << std::endl;
return 0;
}
Live Demo