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>
345 template <
typename T1,
typename T2>
351 template <
typename T1,
typename T2>
352 inline bool operator <(
const pair<T1, T2>& a,
const pair<T1, T2>& b)
354 return (a.first < b.first) ||
355 (!(b.first < a.first) && (a.second < b.second));
359 template <
typename T1,
typename T2>
366 template <
typename T1,
typename T2>
373 template <
typename T1,
typename T2>
391 template <
typename TPair>
394 typedef typename TPair::first_type
type;
426 template <
typename TPair>
429 typedef typename TPair::second_type
type;
449#if ETL_NOT_USING_STL || ETL_CPP14_NOT_SUPPORTED
453 template <
typename T>
461 template <
typename T,
typename U>
462 T
exchange(T&
object,
const U& new_value)
464 T old_value = object;
472 template <
typename T,
typename U = T>
473 T
exchange(T&
object,
const U& new_value)
475 return std::exchange(
object, new_value);
482 template <
typename T>
492 template <
typename T, T... Integers>
493 class integer_sequence
499 typedef T value_type;
501 static ETL_CONSTEXPR
size_t size() ETL_NOEXCEPT
503 return sizeof...(Integers);
507 namespace private_integer_sequence
509 template <
size_t N,
typename IndexSeq>
512 template <
size_t N,
size_t...
Indices>
515 typedef typename make_index_sequence<N - 1,
etl::integer_sequence<size_t, N - 1, Indices...>>::type type;
527 using make_index_sequence =
typename private_integer_sequence::make_index_sequence<N, etl::integer_sequence<size_t>>::type;
530 template <
size_t... Indices>
537 template <
typename T>
587 template <
typename T>
606 template <
typename TReturn,
typename... TParams>
639 template <
typename T>
640 class member_function_wrapper;
642 template <
typename TReturn,
typename... TParams>
643 class member_function_wrapper<TReturn(TParams...)>
660 template <
typename T>
661 class functor_wrapper;
663 template <
typename TReturn,
typename... TParams>
664 class functor_wrapper<TReturn(TParams...)>
668 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:454
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:693
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:705
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:654
void swap(etl::array< T, SIZE > &lhs, etl::array< T, SIZE > &rhs)
Template deduction guides.
Definition array.h:630
ETL_CONSTEXPR TContainer::size_type size(const TContainer &container)
Definition iterator.h:1187
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:642
etl::add_const< T >::type & as_const(T &t)
as_const
Definition utility.h:483
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:666
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:681
integer_sequence
Definition utility.h:539
in_place disambiguation tags.
Definition utility.h:572
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:393
type & operator()(TPair &p) const
Function call that return p.first.
Definition utility.h:400
const type & operator()(const TPair &p) const
Function call that return p.first.
Definition utility.h:408
TPair::first_type type
type of member pair::first.
Definition utility.h:394
Functor to select pair::second.
Definition utility.h:428
type & operator()(TPair &p) const
Function call. The return value is p.second.
Definition utility.h:435
const type & operator()(const TPair &p) const
Function call. The return value is p.second.
Definition utility.h:443
TPair::second_type type
type of member pair::second.
Definition utility.h:429