#include <utility>

template <int N, typename = void>
struct foo : std::integral_constant<int, -1> {};

template <int N>
struct foo<N, typename std::enable_if<(0<=N)&&(N<10)>::type> : std::integral_constant<int, N> {};

#include <iostream>
int main()
{
    std::cout << foo<-1>::value << '\n';
    std::cout << foo<0>::value << '\n';
    std::cout << foo<1>::value << '\n';
    std::cout << foo<9>::value << '\n';
    std::cout << foo<10>::value << '\n';
}