I am writing a class template that is parametrized on size_t,
template<size_t k>
class MyClass {...}
The parameter k should really be less than 10, in this case and I would like it to fail to compile if it goes beyond that. How can I do that in C++11 and above?
MyClass<1> instance1; // ok
MyClass<2> instance2; // ok
MyClass<100> instance100; // fail to compile