31#ifndef ETL_FUNCTIONAL_INCLUDED
32#define ETL_FUNCTIONAL_INCLUDED
71 ETL_CONSTEXPR20 T& get()
const ETL_NOEXCEPT
76 ETL_CONSTEXPR20
operator T&()
const ETL_NOEXCEPT
95 reference_wrapper<T> ref(reference_wrapper<T> t)
97 return reference_wrapper<T>(t.get());
101 template <
typename T>
102 reference_wrapper<const T> cref(
const T& t)
104 return reference_wrapper<const T>(t);
108 template <
typename T>
109 reference_wrapper<const T> cref(reference_wrapper<T> t)
111 return reference_wrapper<const T>(t.get());
115 template <
typename TArgumentType,
typename TResultType>
118 typedef TArgumentType argument_type;
119 typedef TResultType result_type;
123 template <
typename TFirstArgumentType,
typename TSecondArgumentType,
typename TResultType>
126 typedef TFirstArgumentType first_argument_type;
127 typedef TSecondArgumentType second_argument_type;
128 typedef TResultType result_type;
132 template <
typename T =
void>
135 typedef T value_type;
137 ETL_CONSTEXPR
bool operator()(
const T &lhs,
const T &rhs)
const
147 typedef int is_transparent;
149 template <
typename T1,
typename T2>
150 constexpr auto operator()(T1&& lhs, T2&& rhs)
const ->
decltype(
static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs))
152 return static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs);
158 template <
typename T =
void>
161 typedef T value_type;
163 ETL_CONSTEXPR
bool operator()(
const T& lhs,
const T& rhs)
const
173 typedef int is_transparent;
175 template <
typename T1,
typename T2>
176 constexpr auto operator()(T1&& lhs, T2&& rhs)
const ->
decltype(
static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs))
178 return !(
static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs));
184 template <
typename T =
void>
187 typedef T value_type;
189 ETL_CONSTEXPR
bool operator()(
const T &lhs,
const T &rhs)
const
199 typedef int is_transparent;
201 template <
typename T1,
typename T2>
202 constexpr auto operator()(T1&& lhs, T2&& rhs)
const ->
decltype(
static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs))
204 return static_cast<T1&&
>(rhs) <
static_cast<T2&&
>(lhs);
210 template <
typename T =
void>
213 typedef T value_type;
215 ETL_CONSTEXPR
bool operator()(
const T& lhs,
const T& rhs)
const
225 typedef int is_transparent;
227 template <
typename T1,
typename T2>
228 constexpr auto operator()(T1&& lhs, T2&& rhs)
const ->
decltype(
static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs))
230 return static_cast<T1&&
>(rhs) <
static_cast<T2&&
>(lhs);
236 template <
typename T =
void>
239 typedef T value_type;
241 ETL_CONSTEXPR
bool operator()(
const T &lhs,
const T &rhs)
const
251 typedef void value_type;
252 typedef int is_transparent;
254 template <
typename T1,
typename T2>
255 constexpr auto operator()(T1&& lhs, T2&& rhs)
const ->
decltype(
static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs))
257 return static_cast<T1&&
>(lhs) ==
static_cast<T2&&
>(rhs);
263 template <
typename T =
void>
266 typedef T value_type;
268 ETL_CONSTEXPR
bool operator()(
const T &lhs,
const T &rhs)
const
270 return !(lhs == rhs);
278 typedef int is_transparent;
280 template <
typename T1,
typename T2>
281 constexpr auto operator()(T1&& lhs, T2&& rhs)
const ->
decltype(
static_cast<T1&&
>(lhs) <
static_cast<T2&&
>(rhs))
283 return !(
static_cast<T1&&
>(lhs) ==
static_cast<T2&&
>(rhs));
289 template <
typename TFunction>
295 typename TFunction::first_argument_type value;
299 binder1st(
const TFunction& f,
const typename TFunction::first_argument_type& v)
300 : operation(f), value(v)
304 typename TFunction::result_type operator()(
typename TFunction::second_argument_type& x)
const
306 return operation(value, x);
309 typename TFunction::result_type operator()(
const typename TFunction::second_argument_type& x)
const
311 return operation(value, x);
315 template <
typename F,
typename T>
322 template <
typename TFunction >
327 typename TFunction::second_argument_type value;
329 binder2nd(
const TFunction& f,
const typename TFunction::second_argument_type& v)
330 : operation(f), value(v)
334 typename TFunction::result_type operator()(
typename TFunction::first_argument_type& x)
const
336 return operation(x, value);
339 typename TFunction::result_type operator()(
const typename TFunction::first_argument_type& x)
const
341 return operation(x, value);
345 template <
typename F,
typename T>
352 template <
typename T =
void>
355 typedef T first_argument_type;
356 typedef T second_argument_type;
357 typedef T result_type;
359 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
366 template <
typename T =
void>
369 typedef T first_argument_type;
370 typedef T second_argument_type;
371 typedef T result_type;
373 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
380 template <
typename T =
void>
383 typedef T argument_type;
384 typedef T result_type;
386 ETL_CONSTEXPR T operator()(
const T& lhs)
const
393 template <
typename T =
void>
396 typedef T first_argument_type;
397 typedef T second_argument_type;
398 typedef T result_type;
400 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
407 template <
typename T =
void>
410 typedef T first_argument_type;
411 typedef T second_argument_type;
412 typedef T result_type;
414 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
421 template <
typename T =
void>
424 typedef T first_argument_type;
425 typedef T second_argument_type;
426 typedef T result_type;
428 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
435 template <
typename T =
void>
438 typedef T first_argument_type;
439 typedef T second_argument_type;
440 typedef T result_type;
442 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
449 template <
typename T =
void>
452 typedef T first_argument_type;
453 typedef T second_argument_type;
454 typedef T result_type;
456 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
463 template <
typename T =
void>
466 typedef T first_argument_type;
467 typedef T second_argument_type;
468 typedef T result_type;
470 ETL_CONSTEXPR T operator()(
const T& lhs)
const
477 template <
typename T =
void>
480 typedef T first_argument_type;
481 typedef T second_argument_type;
482 typedef T result_type;
484 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
491 template <
typename T =
void>
494 typedef T first_argument_type;
495 typedef T second_argument_type;
496 typedef T result_type;
498 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
505 template <
typename T =
void>
508 typedef T first_argument_type;
509 typedef T second_argument_type;
510 typedef T result_type;
512 ETL_CONSTEXPR T operator()(
const T& lhs,
const T& rhs)
const
519 template <
typename T =
void>
522 typedef T first_argument_type;
523 typedef T second_argument_type;
524 typedef T result_type;
526 ETL_CONSTEXPR T operator()(
const T& lhs)
const
Definition: functional.h:291
Definition: functional.h:324
Definition: functional.h:50
bitset_ext
Definition: absolute.h:38
Definition: functional.h:125
Definition: functional.h:479
Definition: functional.h:521
Definition: functional.h:493
Definition: functional.h:507
Definition: functional.h:409
Definition: functional.h:238
Definition: functional.h:212
Definition: functional.h:186
Definition: functional.h:160
Definition: functional.h:134
Definition: functional.h:437
Definition: functional.h:465
Definition: functional.h:451
Definition: functional.h:368
Definition: functional.h:423
Definition: functional.h:395
Definition: functional.h:382
Definition: functional.h:265
Definition: functional.h:354
Definition: functional.h:117