31#ifndef ETL_UTILITY_INCLUDED
32#define ETL_UTILITY_INCLUDED
37#if defined(ETL_IN_UNIT_TEST) || ETL_USING_STL
62 return static_cast<T&&
>(t);
69 return static_cast<T&&
>(t);
82 template <
typename T,
typename U>
86 forward_like(U&& u) ETL_NOEXCEPT
94 template <
typename T,
typename U>
98 forward_like(U&& u) ETL_NOEXCEPT
106 template <
typename T,
typename U>
110 forward_like(U&& u) ETL_NOEXCEPT
118 template <
typename T,
typename U>
122 forward_like(U&& u) ETL_NOEXCEPT
130 template <
typename T,
typename U>
136#if ETL_NOT_USING_STL && !defined(ETL_IN_UNIT_TEST)
139 template <
typename T>
140 ETL_CONSTEXPR14
void swap(T& a, T& b) ETL_NOEXCEPT
147 template<
class T,
size_t N >
148 ETL_CONSTEXPR14
void swap(T(&a)[N], T(&b)[N]) ETL_NOEXCEPT
150 for (
size_t i = 0UL; i < N; ++i)
162 template <
typename T1,
typename T2>
197 template <
typename U1,
typename U2>
210 template <
typename U1,
typename U2>
226 template <
typename U1,
typename U2>
234#if defined(ETL_IN_UNIT_TEST) || ETL_USING_STL
236 template <
typename U1,
typename U2>
237 operator std::pair<U1, U2>()
243 template <
typename U1,
typename U2>
252 template <
typename U1,
typename U2>
263 using ETL_OR_STD::swap;
277 template <
typename U1,
typename U2>
295 template <
typename U1,
typename U2>
315 template <
typename T1,
typename T2>
316 inline pair<T1, T2>
make_pair(T1&& a, T2&& b)
321 template <
typename T1,
typename T2>
329 template <
typename T1,
typename T2>
330 inline void swap(pair<T1, T2>& a, pair<T1, T2>& b)
336 template <
typename T1,
typename T2>
343 template <
typename T1,
typename T2>
349 template <
typename T1,
typename T2>
350 inline bool operator <(
const pair<T1, T2>& a,
const pair<T1, T2>& b)
352 return (a.first < b.first) ||
353 (!(b.first < a.first) && (a.second < b.second));
357 template <
typename T1,
typename T2>
364 template <
typename T1,
typename T2>
371 template <
typename T1,
typename T2>
389 template <
typename TPair>
392 typedef typename TPair::first_type
type;
424 template <
typename TPair>
427 typedef typename TPair::second_type
type;
447#if ETL_NOT_USING_STL || ETL_CPP14_NOT_SUPPORTED
451 template <
typename T>
459 template <
typename T,
typename U>
460 T
exchange(T&
object,
const U& new_value)
462 T old_value = object;
470 template <
typename T,
typename U = T>
471 T
exchange(T&
object,
const U& new_value)
473 return std::exchange(
object, new_value);
480 template <
typename T>
490 template <
typename T, T... Integers>
491 class integer_sequence
497 typedef T value_type;
499 static ETL_CONSTEXPR
size_t size() ETL_NOEXCEPT
501 return sizeof...(Integers);
505 namespace private_integer_sequence
507 template <
size_t N,
typename IndexSeq>
510 template <
size_t N,
size_t...
Indices>
513 typedef typename make_index_sequence<N - 1,
etl::integer_sequence<size_t, N - 1, Indices...>>::type type;
525 using make_index_sequence =
typename private_integer_sequence::make_index_sequence<N, etl::integer_sequence<size_t>>::type;
528 template <
size_t... Indices>
535 template <
typename T>
585 template <
typename T>
604 template <
typename TReturn,
typename... TParams>
637 template <
typename T>
638 class member_function_wrapper;
640 template <
typename TReturn,
typename... TParams>
641 class member_function_wrapper<TReturn(TParams...)>
658 template <
typename T>
659 class functor_wrapper;
661 template <
typename TReturn,
typename... TParams>
662 class functor_wrapper<TReturn(TParams...)>
666 template <
typename TFunctor, TFunctor& Instance>
is_integral
Definition type_traits_generator.h:1001
is_lvalue_reference
Definition type_traits_generator.h:1121
bitset_ext
Definition absolute.h:38
pair< T1, T2 > make_pair(T1 a, T2 b)
A convenience wrapper for creating a pair from two objects.
Definition utility.h:322
T exchange(T &object, const T &new_value)
exchange (const)
Definition utility.h:452
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:684
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:696
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:645
void swap(etl::array< T, SIZE > &lhs, etl::array< T, SIZE > &rhs)
Template deduction guides.
Definition array.h:621
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:633
etl::add_const< T >::type & as_const(T &t)
as_const
Definition utility.h:481
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:657
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:672
integer_sequence
Definition utility.h:537
in_place disambiguation tags.
Definition utility.h:570
pair holds two objects of arbitrary type
Definition utility.h:164
T1 first_type
first_type is the first bound type
Definition utility.h:165
pair(const std::pair< U1, U2 > &other)
Constructing from std::pair.
Definition utility.h:244
T1 first
first is a copy of the first object
Definition utility.h:168
ETL_CONSTEXPR pair()
Default constructor.
Definition utility.h:176
ETL_CONSTEXPR14 pair(const T1 &a, const T2 &b)
Constructor from parameters.
Definition utility.h:187
operator std::pair< U1, U2 >()
Converting to std::pair.
Definition utility.h:237
ETL_CONSTEXPR14 pair(const pair< U1, U2 > &other)
Copy constructor.
Definition utility.h:211
pair(const pair< T1, T2 > &other)
Copy constructor.
Definition utility.h:218
T2 second
second is a copy of the second object
Definition utility.h:169
T2 second_type
second_type is the second bound type
Definition utility.h:166
Functor to select pair::first.
Definition utility.h:391
type & operator()(TPair &p) const
Function call that return p.first.
Definition utility.h:398
const type & operator()(const TPair &p) const
Function call that return p.first.
Definition utility.h:406
TPair::first_type type
type of member pair::first.
Definition utility.h:392
Functor to select pair::second.
Definition utility.h:426
type & operator()(TPair &p) const
Function call. The return value is p.second.
Definition utility.h:433
const type & operator()(const TPair &p) const
Function call. The return value is p.second.
Definition utility.h:441
TPair::second_type type
type of member pair::second.
Definition utility.h:427