I currently use a template class with multiple parameters,
template<class A, class B> class M{ };
However, in the position of class A
I want to insert a template class, something like
template<class C> class A{ };
The only solution I've found for doing this is to use template template parameters:
template< template<class C> class A, class B> class M{ };
In my implementation, the only parameterization of A
I use is A<B>
. I don't need several instantiations of A
using different parameters, for example I don't need to instantiate A<int>
A<double>
and A<long double>
in M
.
Is there an alternative to the template template parameter? The reason I ask is a follow up of this thread, in which in his answer @Evan Teran says he's only once ever had to use template template parameters...
I guess a twist on my question is: are there downsides to using template template parameters?