I recently stumbled over the following C++ Code which confused me a bit:class One {/*definition*/};template<class Base > class Two : public Base {/*definition*/};template<class Base > class Three : public Base {/*definition*/};template<class Base > class Four : public Base {/*definition*/};class Five : public Four < Three< Two < One > > > {/*definition*/};I know the purpose of templates and more or less when and how to use them. Is there a name or a common pattern for a cascade of several templates?When would I use this pattern (instead of anything less complex)?P.S.: definition of class Five actually is empty.
Is this a specific pattern and what is its purpose?
design patterns;c++;use case
At a guess I'd say that the author was implementing a form of mixin. The class with the object's primary functionality would be One, but Two, Three etc are adding various pieces of orthogonal functionality that aren't particularly coupled to the primary class. Five is then just a placeholder for taking the aggregation. 