I read the Loki source code, I doubt why use ScatterHierarchyTag head?
----------------------------------------------------------------------------------------------------------------
namespace Private
{
template<class, class>
struct ScatterHierarchyTag;
}
template <class TList, template <class> class Unit>
class GenScatterHierarchy;
template <class T1, class T2, template <class> class Unit>
class GenScatterHierarchy<Typelist<T1, T2>, Unit>
: public GenScatterHierarchy<Private::ScatterHierarchyTag<T 1,
T2>, Unit>
, public GenScatterHierarchy<T2, Unit>
{
public:
typedef Typelist<T1, T2> TList;
typedef GenScatterHierarchy<Private::ScatterHierarchyTag<T 1,
T2>, Unit> LeftBase;
typedef GenScatterHierarchy<T2, Unit> RightBase;
template <typename T> struct Rebind
{
typedef Unit<T> Result;
};
};
template <class T1, class T2, template <class> class Unit>
class GenScatterHierarchy<Private::ScatterHierarchyTag<T 1, T2>,
Unit>
: public GenScatterHierarchy<T1, Unit>
{
};
template <class AtomicType, template <class> class Unit>
class GenScatterHierarchy : public Unit<AtomicType>
{
typedef Unit<AtomicType> LeftBase;
template <typename T> struct Rebind
{
typedef Unit<T> Result;
};
};
template <template <class> class Unit>
class GenScatterHierarchy<NullType, Unit>
{
template <typename T> struct Rebind
{
typedef Unit<T> Result;
};
};