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>
123 template <
typename TFirstArgumentType,
typename TSecondArgumentType,
typename TResultType>
132 template <
typename T =
void>
137 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
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>
163 ETL_CONSTEXPR
bool operator()(
const T&
lhs,
const T&
rhs)
const
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>
189 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
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>
215 ETL_CONSTEXPR
bool operator()(
const T&
lhs,
const T&
rhs)
const
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>
241 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
251 typedef void value_type;
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>
268 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
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;
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;
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>
359 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
366 template <
typename T =
void>
373 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
380 template <
typename T =
void>
386 ETL_CONSTEXPR
T operator()(
const T&
lhs)
const
393 template <
typename T =
void>
400 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
407 template <
typename T =
void>
414 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
421 template <
typename T =
void>
428 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
435 template <
typename T =
void>
442 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
449 template <
typename T =
void>
456 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
463 template <
typename T =
void>
470 ETL_CONSTEXPR
T operator()(
const T&
lhs)
const
477 template <
typename T =
void>
484 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
491 template <
typename T =
void>
498 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
505 template <
typename T =
void>
512 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
519 template <
typename T =
void>
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
pair holds two objects of arbitrary type
Definition utility.h:164
Definition functional.h:354
Definition functional.h:117