Alexandria  2.27.0
SDC-CH common library for the Euclid project
Functors.h
Go to the documentation of this file.
1 
19 #ifndef PYSTON_FUNCTORS_H
20 #define PYSTON_FUNCTORS_H
21 
22 #include <cmath>
23 
24 namespace Pyston {
25 
29 template <typename T>
30 struct Identity : public std::unary_function<T, T> {
31  T operator()(T value) const {
32  return value;
33  }
34 };
35 
47 template <typename R, typename T, R (*wrapped)(T)>
48 struct UnaryWrapper : public std::unary_function<T, R> {
49  R operator()(T value) const {
50  return wrapped(value);
51  }
52 };
53 
65 template <typename R, typename T, R (*wrapped)(T, T)>
66 struct BinaryWrapper : public std::binary_function<T, T, R> {
67  R operator()(T left, T right) const {
68  return wrapped(left, right);
69  }
70 };
71 
73 template <typename T>
75 
77 template <typename T>
79 
81 template <typename T>
83 
85 template <typename T>
87 
89 template <typename T>
91 
93 template <typename T>
95 
97 template <typename T>
99 
101 template <typename T>
103 
105 template <typename T>
107 
109 template <typename T>
111 
113 template <typename T>
115 
117 template <typename T>
119 
121 template <typename T>
123 
125 template <typename T>
127 
129 template <typename T>
131 
133 template <typename T>
135 
137 template <typename T>
139 
141 template <typename T>
143 
145 template <typename T>
147 
149 template <typename T>
151 
153 template <typename T>
155 
157 template <typename T>
159 
161 template <typename T>
163 
164 } // namespace Pyston
165 
166 #endif // PYSTON_FUNCTORS_H
R operator()(T left, T right) const
Definition: Functors.h:67
T operator()(T value) const
Definition: Functors.h:31
R operator()(T value) const
Definition: Functors.h:49