Sacado Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Sacado_mpl_quote.hpp
Go to the documentation of this file.
1// $Id$
2// $Source$
3// @HEADER
4// ***********************************************************************
5//
6// Sacado Package
7// Copyright (2006) Sandia Corporation
8//
9// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
10// the U.S. Government retains certain rights in this software.
11//
12// This library is free software; you can redistribute it and/or modify
13// it under the terms of the GNU Lesser General Public License as
14// published by the Free Software Foundation; either version 2.1 of the
15// License, or (at your option) any later version.
16//
17// This library is distributed in the hope that it will be useful, but
18// WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20// Lesser General Public License for more details.
21//
22// You should have received a copy of the GNU Lesser General Public
23// License along with this library; if not, write to the Free Software
24// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
25// USA
26// Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
27// (etphipp@sandia.gov).
28//
29// ***********************************************************************
30// @HEADER
31
32#ifndef SACADO_MPL_QUOTE_HPP
33#define SACADO_MPL_QUOTE_HPP
34
36
37namespace Sacado {
38
39 namespace mpl {
40
41 // Transform a class/template to a metafunction class
42 // (nested template apply)
43 template <class F>
44 struct quote0 {
45 struct apply : mpl::type_wrap< F > {};
46 };
47
48 template <template<class T1> class F>
49 struct quote1 {
50 template <class T1>
51 struct apply : mpl::type_wrap< F<T1> > {};
52 };
53
54 template < template<class T1,
55 class T2> class F>
56 struct quote2 {
57 template <class T1,
58 class T2>
59 struct apply : mpl::type_wrap< F<T1,T2> >{};
60 };
61
62 template < template<class T1,
63 class T2,
64 class T3> class F>
65 struct quote3 {
66 template <class T1,
67 class T2,
68 class T3>
69 struct apply : mpl::type_wrap< F<T1,T2,T3> >{};
70 };
71
72 template < template<class T1,
73 class T2,
74 class T3,
75 class T4> class F>
76 struct quote4 {
77 template <class T1,
78 class T2,
79 class T3,
80 class T4>
81 struct apply : mpl::type_wrap< F<T1,T2,T3,T4> >{};
82 };
83
84 template < template<class T1,
85 class T2,
86 class T3,
87 class T4,
88 class T5> class F>
89 struct quote5 {
90 template <class T1,
91 class T2,
92 class T3,
93 class T4,
94 class T5>
95 struct apply : mpl::type_wrap< F<T1,T2,T3,T4,T5> >{};
96 };
97
98 template <class F>
99 struct quote : quote0<F> {};
100
101 template < template<class T1> class F,
102 class T1>
103 struct quote< F<T1> > : quote1<F> {};
104
105 template < template<class T1,
106 class T2> class F,
107 class T1,
108 class T2>
109 struct quote< F<T1,T2> > : quote2<F> {};
110
111 template < template<class T1,
112 class T2,
113 class T3> class F,
114 class T1,
115 class T2,
116 class T3>
117 struct quote< F<T1,T2,T3> > : quote3<F> {};
118
119 template < template<class T1,
120 class T2,
121 class T3,
122 class T4> class F,
123 class T1,
124 class T2,
125 class T3,
126 class T4>
127 struct quote< F<T1,T2,T3,T4> > : quote4<F> {};
128
129 template < template<class T1,
130 class T2,
131 class T3,
132 class T4,
133 class T5> class F,
134 class T1,
135 class T2,
136 class T3,
137 class T4,
138 class T5>
139 struct quote< F<T1,T2,T3,T4,T5> > : quote5<F> {};
140
141 } // namespace mpl
142
143} // namespace Sacado
144
145#endif // SACADO_MPL_QUOTE_HPP
#define T1(r, f)
#define F
#define T2(r, f)