template <typename X, typename Y> class A {
};
enum Property {P1,P2};
template <Property P> class B {};
class C {};
Is there a way to define a partial specialization Asuch that it A<C, B<P1> >will be a Anormal template, but A<C, B<P2> >will be a specialization?
Change in response to Marcelo: In particular, specialization should be chosen not only with B, but also with any type that demonstrates a certain property, for example, that this is a template whose first argument is P2.
The goal is to use Yto present a nice interface for Aallowing you to write something like A<C, Y<P2,Q> >.
Replacing the template Yparameter with the template template parameter will be nice, but is there a way to partially specialize it on the basis P, and then?
The intention would be to write something like:
template <typename X, template <Property P> typename Y> class A {};
template <typename X> class A<X,template<> Y<P2> > {};
Edit in response to In silico: I said that it would be nice to make Ya template template parameter, but in fact it wins the goal of what I wanted to do, namely to use Ylogically related properties together for grouping, but still specialize Ain basis of one of these sub-properties.
Is there a way by adding traits to the specialization template <> class B<P2>and then using SFINAE's A? The intention would be to write something like:
template <> class B<P2> {
typedef int IAmP2;
};
template <typename X, typename Y> class A {
typename Y::IAmP2 skipIfNotP2;
};