I haven't been doing this for a while. I basically have a class
template <int L>
class MyInteger {
//code
};
And specifically I'd like to implement something like (as a method)
template <int L, int M, int N>
MyInteger<N> MyInteger<L>::operator+(const MyInteger<M>& x) const;
But I want to restrict N
to be the max(L,M)
is there a way to achieve that using template metaprogramming? I was thinking the use of enable_if
and maybe SFINAE could allow me to achieve what I want, but I'm not entirely sure how to do that.