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_lambda.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_LAMBDA_HPP
11 #define SACADO_MPL_LAMBDA_HPP
12 
13 #include "Sacado_mpl_bind.hpp"
14 #include "Sacado_mpl_quote.hpp"
15 #include "Sacado_mpl_type_wrap.hpp"
16 #include "Sacado_mpl_if.hpp"
18 
19 namespace Sacado {
20 
21  namespace mpl {
22 
23  template <class F> struct lambda : mpl::type_wrap<F> {};
24 
25  template <template<class T1> class F,
26  class T1>
27  struct lambda< F<T1> > :
28  mpl_if< is_placeholder< F<T1> >,
29  type_wrap< bind1< quote1<F>,
30  typename lambda<T1>::type > >,
31  type_wrap< F<T1> > > {};
32 
33  template <template<class T1, class T2> class F,
34  class T1,
35  class T2>
36  struct lambda< F<T1,T2> > :
37  mpl_if< is_placeholder< F<T1,T2> >,
38  type_wrap< bind2< quote2<F>,
39  typename lambda<T1>::type,
40  typename lambda<T2>::type > >,
41  type_wrap< F<T1,T2> > > {};
42 
43  template <template<class T1, class T2, class T3> class F,
44  class T1,
45  class T2,
46  class T3>
47  struct lambda< F<T1,T2,T3> > :
48  mpl_if< is_placeholder< F<T1,T2,T3> >,
49  type_wrap< bind3< quote3<F>,
50  typename lambda<T1>::type,
51  typename lambda<T2>::type,
52  typename lambda<T3>::type > >,
53  type_wrap< F<T1,T2,T3> > > {};
54 
55  template <template<class T1, class T2, class T3, class T4> class F,
56  class T1,
57  class T2,
58  class T3,
59  class T4>
60  struct lambda< F<T1,T2,T3,T4> > :
61  mpl_if< is_placeholder< F<T1,T2,T3,T4> >,
62  type_wrap< bind4< quote4<F>,
63  typename lambda<T1>::type,
64  typename lambda<T2>::type,
65  typename lambda<T3>::type,
66  typename lambda<T4>::type > >,
67  type_wrap< F<T1,T2,T3,T4> > > {};
68 
69  template <template<class T1, class T2, class T3, class T4, class T5> class F,
70  class T1,
71  class T2,
72  class T3,
73  class T4,
74  class T5>
75  struct lambda< F<T1,T2,T3,T4,T5> > :
76  mpl_if< is_placeholder< F<T1,T2,T3,T4,T5> >,
77  type_wrap< bind5< quote5<F>,
78  typename lambda<T1>::type,
79  typename lambda<T2>::type,
80  typename lambda<T3>::type,
81  typename lambda<T4>::type,
82  typename lambda<T5>::type > >,
83  type_wrap< F<T1,T2,T3,T4,T5> > > {};
84 
85  } // namespace mpl
86 
87 } // namespace Sacado
88 
89 #endif // SACADO_MPL_LAMBDA_HPP
Sacado::Fad::DFad< double > F
Definition: ad_example.cpp:20
#define T2(r, f)
Definition: Sacado_rad.hpp:558
#define T1(r, f)
Definition: Sacado_rad.hpp:583