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_placeholders.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_PLACEHOLDERS_HPP
33 #define SACADO_MPL_PLACEHOLDERS_HPP
34 
35 #include "Sacado_mpl_none.hpp"
36 
37 namespace Sacado {
38 
39  namespace mpl {
40 
41  // Placeholder definitions
42  template <int N> struct arg {};
43 
44  template <> struct arg<1> {
45  template <class A1,
46  class A2=mpl::none,
47  class A3=mpl::none,
48  class A4=mpl::none,
49  class A5=mpl::none>
50  struct apply {
51  typedef A1 type;
52  };
53  };
54  template <> struct arg<2> {
55  template <class A1,
56  class A2,
57  class A3=mpl::none,
58  class A4=mpl::none,
59  class A5=mpl::none>
60  struct apply {
61  typedef A2 type;
62  };
63  };
64  template <> struct arg<3> {
65  template <class A1,
66  class A2,
67  class A3,
68  class A4=mpl::none,
69  class A5=mpl::none>
70  struct apply {
71  typedef A3 type;
72  };
73  };
74  template <> struct arg<4> {
75  template <class A1,
76  class A2,
77  class A3,
78  class A4,
79  class A5=mpl::none>
80  struct apply {
81  typedef A4 type;
82  };
83  };
84  template <> struct arg<5> {
85  template <class A1,
86  class A2,
87  class A3,
88  class A4,
89  class A5>
90  struct apply {
91  typedef A5 type;
92  };
93  };
94 
95  // Placeholder synonyms
96  namespace placeholders {
97  typedef arg<1> _1;
98  typedef arg<2> _2;
99  typedef arg<3> _3;
100  typedef arg<4> _4;
101  typedef arg<5> _5;
102  typedef arg<-1> _;
103  } // namespace placeholders
104 
105  } // namespace mpl
106 
107 } // namespace Sacado
108 
109 #endif // SACADO_MPL_PLACEHOLDERS_HPP