This is a standard method that is often used in the recursive definition of template .
An example of such a technique can be a sequence of integers:
template<int...s> struct seq {typedef seq<s...> type;};
In particular, in their generation:
template<int max, int... s> struct make_seq:make_seq<max-1, max-1, s...> {}; template<int... s> struct make_seq<0, s...>:seq<s...> {};
which is described recursively and simply by inheriting from another instance of template .
To be explicit, make_seq<7>::type is seq<0,1,2,3,4,5,6> through 7 levels of recursive inheritance.
source share