//////////////////////////////////////////////////////////////////////////////// // The Loki Library // Copyright (c) 2001 by Andrei Alexandrescu // This code accompanies the book: // Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design // Patterns Applied". Copyright (c) 2001. Addison-Wesley. // Permission to use, copy, modify, distribute and sell this software for any // purpose is hereby granted without fee, provided that the above copyright // notice appear in all copies and that both that copyright notice and this // permission notice appear in supporting documentation. // The author or Addison-Welsey Longman make no representations about the // suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// // Last update: March 05, 2001 #ifndef HIERARCHYGENERATORS_INC_ #define HIERARCHYGENERATORS_INC_ #include "Typelist.h" #include "TypeTraits.h" #include "EmptyType.h" namespace Loki { //////////////////////////////////////////////////////////////////////////////// // class template GenScatterHierarchy // Generates a scattered hierarchy starting from a typelist and a template // Invocation (TList is a typelist, Model is a template of one arg): // GenScatterHierarchy // The generated class inherits all classes generated by instantiating the // template 'Model' with the types contained in TList //////////////////////////////////////////////////////////////////////////////// template class Unit> class GenScatterHierarchy; template class Unit> class GenScatterHierarchy, Unit> : public GenScatterHierarchy , public GenScatterHierarchy { public: typedef Typelist TList; typedef GenScatterHierarchy LeftBase; typedef GenScatterHierarchy RightBase; template struct Rebind { typedef Unit Result; }; }; template class Unit> class GenScatterHierarchy : public Unit { typedef Unit LeftBase; template struct Rebind { typedef Unit Result; }; }; template