31#ifndef ETL_FUNCTIONAL_INCLUDED
32#define ETL_FUNCTIONAL_INCLUDED
72 ETL_CONSTEXPR20
T& get()
const ETL_NOEXCEPT
77 ETL_CONSTEXPR20
operator T&()
const ETL_NOEXCEPT
96 reference_wrapper<T> ref(reference_wrapper<T> t)
98 return reference_wrapper<T>(t.get());
102 template <
typename T>
103 reference_wrapper<const T> cref(
const T& t)
105 return reference_wrapper<const T>(t);
109 template <
typename T>
110 reference_wrapper<const T> cref(reference_wrapper<T> t)
112 return reference_wrapper<const T>(t.get());
116 template <
typename TArgumentType,
typename TResultType>
124 template <
typename TFirstArgumentType,
typename TSecondArgumentType,
typename TResultType>
133 template <
typename T =
void>
138 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
150 template <
typename T1,
typename T2>
151 constexpr auto operator()(
T1&&
lhs,
T2&&
rhs)
const ->
decltype(
static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs))
153 return static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs);
159 template <
typename T =
void>
164 ETL_CONSTEXPR
bool operator()(
const T&
lhs,
const T&
rhs)
const
176 template <
typename T1,
typename T2>
177 constexpr auto operator()(
T1&&
lhs,
T2&&
rhs)
const ->
decltype(
static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs))
179 return !(
static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs));
185 template <
typename T =
void>
190 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
202 template <
typename T1,
typename T2>
203 constexpr auto operator()(
T1&&
lhs,
T2&&
rhs)
const ->
decltype(
static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs))
205 return static_cast<T1&&
>(
rhs) <
static_cast<T2&&
>(
lhs);
211 template <
typename T =
void>
216 ETL_CONSTEXPR
bool operator()(
const T&
lhs,
const T&
rhs)
const
228 template <
typename T1,
typename T2>
229 constexpr auto operator()(
T1&&
lhs,
T2&&
rhs)
const ->
decltype(
static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs))
231 return static_cast<T1&&
>(
rhs) <
static_cast<T2&&
>(
lhs);
237 template <
typename T =
void>
242 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
252 typedef void value_type;
255 template <
typename T1,
typename T2>
256 constexpr auto operator()(
T1&&
lhs,
T2&&
rhs)
const ->
decltype(
static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs))
258 return static_cast<T1&&
>(
lhs) ==
static_cast<T2&&
>(
rhs);
264 template <
typename T =
void>
269 ETL_CONSTEXPR
bool operator()(
const T &
lhs,
const T &
rhs)
const
281 template <
typename T1,
typename T2>
282 constexpr auto operator()(
T1&&
lhs,
T2&&
rhs)
const ->
decltype(
static_cast<T1&&
>(
lhs) <
static_cast<T2&&
>(
rhs))
284 return !(
static_cast<T1&&
>(
lhs) ==
static_cast<T2&&
>(
rhs));
290 template <
typename TFunction>
296 typename TFunction::first_argument_type value;
301 : operation(
f), value(
v)
305 typename TFunction::result_type operator()(
typename TFunction::second_argument_type& x)
const
307 return operation(value, x);
310 typename TFunction::result_type operator()(
const typename TFunction::second_argument_type& x)
const
312 return operation(value, x);
316 template <
typename F,
typename T>
323 template <
typename TFunction >
328 typename TFunction::second_argument_type value;
331 : operation(
f), value(
v)
335 typename TFunction::result_type operator()(
typename TFunction::first_argument_type& x)
const
337 return operation(x, value);
340 typename TFunction::result_type operator()(
const typename TFunction::first_argument_type& x)
const
342 return operation(x, value);
346 template <
typename F,
typename T>
353 template <
typename T =
void>
360 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
367 template <
typename T =
void>
374 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
381 template <
typename T =
void>
387 ETL_CONSTEXPR
T operator()(
const T&
lhs)
const
394 template <
typename T =
void>
401 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
408 template <
typename T =
void>
415 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
422 template <
typename T =
void>
429 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
436 template <
typename T =
void>
443 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
450 template <
typename T =
void>
457 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
464 template <
typename T =
void>
471 ETL_CONSTEXPR
T operator()(
const T&
lhs)
const
478 template <
typename T =
void>
485 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
492 template <
typename T =
void>
499 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
506 template <
typename T =
void>
513 ETL_CONSTEXPR
T operator()(
const T&
lhs,
const T&
rhs)
const
520 template <
typename T =
void>
527 ETL_CONSTEXPR
T operator()(
const T&
lhs)
const
549 ETL_CONSTEXPR TReturnType operator()(TClassType& instance, TArgs... args)
const
556 MemberFunctionType member_function;
565 typedef TReturnType(TClassType::* MemberFunctionType)(TArgs...) const;
567 ETL_CONSTEXPR const_mem_fn_impl(MemberFunctionType member_function_)
568 : member_function(member_function_)
572 ETL_CONSTEXPR TReturnType operator()(
const TClassType& instance, TArgs... args)
const
579 MemberFunctionType member_function;
584 template<
typename TReturnType,
typename TClassType,
typename... TArgs>
586 private_functional::mem_fn_impl<TReturnType, TClassType, TArgs...> mem_fn(TReturnType(TClassType::* member_function)(TArgs...))
588 return private_functional::mem_fn_impl<TReturnType, TClassType, TArgs...>(member_function);
592 template<
typename TReturnType,
typename TClassType,
typename... TArgs>
594 private_functional::const_mem_fn_impl<TReturnType, TClassType, TArgs...> mem_fn(TReturnType(TClassType::* member_function)(TArgs...) const)
596 return private_functional::const_mem_fn_impl<TReturnType, TClassType, TArgs...>(member_function);
Definition functional.h:292
Definition functional.h:325
Definition functional.h:51
bitset_ext
Definition absolute.h:38
Definition functional.h:126
Definition functional.h:480
Definition functional.h:522
Definition functional.h:494
Definition functional.h:508
Definition functional.h:410
Definition functional.h:239
Definition functional.h:213
Definition functional.h:187
Definition functional.h:161
Definition functional.h:135
Definition functional.h:438
Definition functional.h:466
Definition functional.h:452
Definition functional.h:369
Definition functional.h:424
Definition functional.h:396
Definition functional.h:383
Definition functional.h:266
pair holds two objects of arbitrary type
Definition utility.h:164
ETL_CONSTEXPR pair()
Default constructor.
Definition utility.h:176
Definition functional.h:355
Definition functional.h:118