Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_mpl_apply_wrap.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_APPLY_WRAP_HPP
33 #define SACADO_MPL_APPLY_WRAP_HPP
34 
35 #include "Sacado_mpl_none.hpp"
36 
37 namespace Sacado {
38 
39  namespace mpl {
40 
41  // wrapper to call a metafunction class
42  template <class F> struct
43  apply_wrap0 {
44  typedef typename F::apply::type type;
45  };
46 
47  template <class F,
48  class A1>
49  struct apply_wrap1 {
50  typedef typename F::template apply<A1>::type type;
51  };
52 
53  template <class F,
54  class A1,
55  class A2>
56  struct apply_wrap2 {
57  typedef typename F::template apply<A1,A2>::type type;
58  };
59 
60  template <class F,
61  class A1,
62  class A2,
63  class A3>
64  struct apply_wrap3 {
65  typedef typename F::template apply<A1,A2,A3>::type type;
66  };
67 
68  template <class F,
69  class A1,
70  class A2,
71  class A3,
72  class A4>
73  struct apply_wrap4 {
74  typedef typename F::template apply<A1,A2,A3,A4>::type type;
75  };
76 
77  template <class F,
78  class A1,
79  class A2,
80  class A3,
81  class A4,
82  class A5>
83  struct apply_wrap5 {
84  typedef typename F::template apply<A1,A2,A3,A4,A5>::type type;
85  };
86 
87  template <class F,
88  class A1,
89  class A2,
90  class A3,
91  class A4,
92  class A5>
93  struct apply_wrap :
94  apply_wrap5<F,A1,A2,A3,A4,A5> {};
95 
96  template <class F,
97  class A1,
98  class A2,
99  class A3,
100  class A4>
101  struct apply_wrap<F,A1,A2,A3,A4,mpl::none> :
102  apply_wrap4<F,A1,A2,A3,A4> {};
103 
104  template <class F,
105  class A1,
106  class A2,
107  class A3>
108  struct apply_wrap<F,A1,A2,A3,mpl::none,mpl::none> :
109  apply_wrap3<F,A1,A2,A3> {};
110 
111  template <class F,
112  class A1,
113  class A2>
114  struct apply_wrap<F,A1,A2,mpl::none,mpl::none,mpl::none> :
115  apply_wrap2<F,A1,A2> {};
116 
117  template <class F,
118  class A1>
120  apply_wrap1<F,A1> {};
121 
122  template <class F>
124  apply_wrap0<F> {};
125 
126  } // namespace mpl
127 
128 } // namespace Sacado
129 
130 #endif // SACADO_APPLY_TYPE_WRAP_HPP
Sacado::Fad::DFad< double > F
Definition: ad_example.cpp:40
F::template apply< A1, A2, A3, A4 >::type type
F::template apply< A1, A2, A3, A4, A5 >::type type
F::template apply< A1 >::type type
F::template apply< A1, A2, A3 >::type type
F::template apply< A1, A2 >::type type