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 // @HEADER
2 // *****************************************************************************
3 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef SACADO_MPL_APPLY_WRAP_HPP
11 #define SACADO_MPL_APPLY_WRAP_HPP
12 
13 #include "Sacado_mpl_none.hpp"
14 
15 namespace Sacado {
16 
17  namespace mpl {
18 
19  // wrapper to call a metafunction class
20  template <class F> struct
21  apply_wrap0 {
22  typedef typename F::apply::type type;
23  };
24 
25  template <class F,
26  class A1>
27  struct apply_wrap1 {
28  typedef typename F::template apply<A1>::type type;
29  };
30 
31  template <class F,
32  class A1,
33  class A2>
34  struct apply_wrap2 {
35  typedef typename F::template apply<A1,A2>::type type;
36  };
37 
38  template <class F,
39  class A1,
40  class A2,
41  class A3>
42  struct apply_wrap3 {
43  typedef typename F::template apply<A1,A2,A3>::type type;
44  };
45 
46  template <class F,
47  class A1,
48  class A2,
49  class A3,
50  class A4>
51  struct apply_wrap4 {
52  typedef typename F::template apply<A1,A2,A3,A4>::type type;
53  };
54 
55  template <class F,
56  class A1,
57  class A2,
58  class A3,
59  class A4,
60  class A5>
61  struct apply_wrap5 {
62  typedef typename F::template apply<A1,A2,A3,A4,A5>::type type;
63  };
64 
65  template <class F,
66  class A1,
67  class A2,
68  class A3,
69  class A4,
70  class A5>
71  struct apply_wrap :
72  apply_wrap5<F,A1,A2,A3,A4,A5> {};
73 
74  template <class F,
75  class A1,
76  class A2,
77  class A3,
78  class A4>
79  struct apply_wrap<F,A1,A2,A3,A4,mpl::none> :
80  apply_wrap4<F,A1,A2,A3,A4> {};
81 
82  template <class F,
83  class A1,
84  class A2,
85  class A3>
86  struct apply_wrap<F,A1,A2,A3,mpl::none,mpl::none> :
87  apply_wrap3<F,A1,A2,A3> {};
88 
89  template <class F,
90  class A1,
91  class A2>
92  struct apply_wrap<F,A1,A2,mpl::none,mpl::none,mpl::none> :
93  apply_wrap2<F,A1,A2> {};
94 
95  template <class F,
96  class A1>
98  apply_wrap1<F,A1> {};
99 
100  template <class F>
102  apply_wrap0<F> {};
103 
104  } // namespace mpl
105 
106 } // namespace Sacado
107 
108 #endif // SACADO_APPLY_TYPE_WRAP_HPP
Sacado::Fad::DFad< double > F
Definition: ad_example.cpp:20
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