diff --git a/vcg/container/derivation_chain.h b/vcg/container/derivation_chain.h index 933d9b19..fa3fd655 100644 --- a/vcg/container/derivation_chain.h +++ b/vcg/container/derivation_chain.h @@ -28,6 +28,9 @@ namespace vcg{ /*------------------------------------------------------------------*/ // Metaprogramming Core +template < typename T=int> +class DefaultDeriver : public T {}; + template < class Base, template class A> @@ -120,8 +123,47 @@ template < template class K, template class L> class Arity12: public L > {}; -template < typename T=int> -class DefaultDeriver : public T {}; + +// chain with 2 template arguments on the derivers +template < + class Base, + class TA, + template class A > + class MArity1: public A< Base, TA > { + }; + +template < + class Base, + class TA, + template class A, + class TB, + template class B> + class MArity2: public B< MArity1,TB > {}; + +template < + class Base, + class TA, + template class A, + class TB, + template class B, + class TC, + template class C > + class MArity3: public C,TC > {}; + +template < + class Base, + class TA, + template class A, + class TB, + template class B, + class TC, + template class C, + class TD, + template class D> + class MArity4: public D,TD > {}; + + + class DumClass {}; }// end namespace vcg