Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
generator-combinations.hpp
Go to the documentation of this file.
1 /*
2  GENERATOR-COMBINATIONS.hpp - generate combinations and variations
3 
4  Copyright (C) Lumiera.org
5  2011, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
36 #ifndef LIB_META_GENERATOR_COMBINATIONS_H
37 #define LIB_META_GENERATOR_COMBINATIONS_H
38 
39 #include "lib/meta/typelist.hpp"
41 #include "lib/meta/generator.hpp"
42 
43 
44 
45 namespace lib {
46 namespace meta{
47 
48 
49  template<class TYPES_1, class TYPES_2>
51  : Distribute< typename TYPES_1::List
52  , typename TYPES_2::List
53  >
54  { };
55 
56 
57 
58  template< template<class,class,class> class _X_>
60  {
61  template<class SUBLIST, class BASE>
63  : _X_< typename Pick<SUBLIST,0>::Type
64  , typename Pick<SUBLIST,1>::Type
65  , BASE
66  >
67  { };
68  };
69 
70 
86  template
87  < class TYPES_1, class TYPES_2
88  , template<class,class,class> class _X_
89  , class BASE = NullType
90  >
92  : InstantiateChained< typename CartesianProduct<TYPES_1,TYPES_2>::List
93  , PickParametersFromSublist<_X_>::template SingleCaseInstantiation
94  , BASE
95  >
96  { };
97 
98 
99 
100 }} // namespace lib::meta
101 #endif
A template metaprogramming technique for manipulating collections of types.
Helpers for working with lib::meta::Types (i.e.
Implementation namespace for support and library code.
build a list-of lists, where each element of the first arg list gets in turn prepended to all element...
Build a single inheritance chain of template instantiations.
Definition: generator.hpp:129
Metaprogramming: Helpers for manipulating lists-of-types.