Possible Duplicate:
Is there a way to prevent a class from being derived from twice using a static assert and type trait?
我想要防止的是,在D条中产生的基于C的模板不止一个(即从中只应当有一个C的例子)。 希望在C或B条中作出可能解决的静态主张。
// My Classes
template <class T>
class A {};
class B {};
template <class T, class S>
class C : public B, public virtual A<T> {};
// Someone elses code using my classes
class D : public C<Type1, Type2>, public C<Type3, Type4>
{
};