3#ifndef TETL_UTILITY_PAIR_HPP
4#define TETL_UTILITY_PAIR_HPP
35template <
typename T1,
typename T2>
61 template <
typename U1 = T1,
typename U2 = T2>
70 template <
typename U1,
typename U2>
81 template <
typename U1,
typename U2>
100 constexpr auto operator=(
pair const&
p) ->
pair& = default;
102 template <typename U1, typename U2>
103 constexpr auto operator=(
pair<U1, U2> const&
p)
117 template <
typename U1,
typename U2>
142template <
typename T1,
typename T2>
145template <
typename T,
typename U>
149template <
typename T1,
typename T2>
163template <
typename T1,
typename T2>
171template <
typename T1,
typename T2>
174 return (lhs.first == rhs.first) and (lhs.second == rhs.second);
180template <
typename T1,
typename T2>
183 if (lhs.first < rhs.first) {
186 if (rhs.first < lhs.first) {
189 if (lhs.second < rhs.second) {
198template <
typename T1,
typename T2>
207template <
typename T1,
typename T2>
216template <
typename T1,
typename T2>
225template <
typename T1,
typename T2>
231template <
size_t I,
typename T1,
typename T2>
233 static_assert(I < 2,
"pair index out of range");
242template <
size_t I,
typename T1,
typename T2>
245 if constexpr (I == 0) {
257template <
size_t I,
typename T1,
typename T2>
260 if constexpr (I == 0) {
272template <
size_t I,
typename T1,
typename T2>
275 if constexpr (I == 0) {
287template <
size_t I,
typename T1,
typename T2>
290 if constexpr (I == 0) {
302 template <
typename>
typename TQual,
303 template <
typename>
typename UQual>
#define TETL_NO_UNIQUE_ADDRESS
Definition attributes.hpp:41
constexpr auto move(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Moves the elements in the range [first, last), to another range beginning at destination,...
Definition move.hpp:26
Definition adjacent_find.hpp:8
constexpr bool is_copy_constructible_v
Definition is_copy_constructible.hpp:30
constexpr auto operator==(inplace_function< R(Args...), Capacity, Alignment > const &f, nullptr_t) noexcept -> bool
Compares a etl::inplace_function with a null pointer. Empty functions (that is, functions without a c...
Definition inplace_function.hpp:262
typename conditional< B, T, F >::type conditional_t
Definition conditional.hpp:21
pair(T1, T2) -> pair< T1, T2 >
constexpr bool is_constructible_v
Definition is_constructible.hpp:24
constexpr auto is_tuple_like
Definition is_tuple_like.hpp:9
typename etl::decay< T >::type decay_t
Definition decay.hpp:32
constexpr auto get(complex< X > &z) noexcept -> X &
Definition complex.hpp:92
constexpr bool is_default_constructible_v
Definition is_default_constructible.hpp:26
constexpr bool is_assignable_v
Definition is_assignable.hpp:20
constexpr auto is_implicit_default_constructible_v
Definition is_implicit_default_constructible.hpp:26
constexpr auto operator<(etl::reverse_iterator< Iter1 > const &lhs, etl::reverse_iterator< Iter2 > const &rhs) -> bool
Compares the underlying iterators. Inverse comparisons are applied in order to take into account that...
Definition reverse_iterator.hpp:167
constexpr auto make_pair(T1 &&t, T2 &&u) -> pair< decay_t< T1 >, decay_t< T2 > >
Creates a etl::pair object, deducing the target type from the types of arguments.
Definition pair.hpp:164
constexpr auto operator<=(etl::reverse_iterator< Iter1 > const &lhs, etl::reverse_iterator< Iter2 > const &rhs) -> bool
Compares the underlying iterators. Inverse comparisons are applied in order to take into account that...
Definition reverse_iterator.hpp:177
auto swap(inplace_function< R(Args...), Capacity, Alignment > &lhs, inplace_function< R(Args...), Capacity, Alignment > &rhs) noexcept -> void
Overloads the etl::swap algorithm for etl::inplace_function. Exchanges the state of lhs with that of ...
Definition inplace_function.hpp:249
constexpr auto operator>(etl::reverse_iterator< Iter1 > const &lhs, etl::reverse_iterator< Iter2 > const &rhs) -> bool
Compares the underlying iterators. Inverse comparisons are applied in order to take into account that...
Definition reverse_iterator.hpp:185
constexpr auto operator>=(etl::reverse_iterator< Iter1 > const &lhs, etl::reverse_iterator< Iter2 > const &rhs) -> bool
Compares the underlying iterators. Inverse comparisons are applied in order to take into account that...
Definition reverse_iterator.hpp:195
constexpr bool is_convertible_v
Definition is_convertible.hpp:46
typename tuple_element< I, T >::type tuple_element_t
Definition tuple_element.hpp:20
constexpr auto forward(remove_reference_t< T > ¶m) noexcept -> T &&
Forwards lvalues as either lvalues or as rvalues, depending on T. When t is a forwarding reference (a...
Definition forward.hpp:18
constexpr bool is_nothrow_swappable_v
Definition is_nothrow_swappable.hpp:19
constexpr bool is_move_assignable_v
Definition is_move_assignable.hpp:29
typename common_reference< T... >::type common_reference_t
Definition common_reference.hpp:38
pair< common_reference_t< TQual< T1 >, UQual< U1 > >, common_reference_t< TQual< T2 >, UQual< U2 > > > type
Definition pair.hpp:308
The class template basic_common_reference is a customization point that allows users to influence the...
Definition basic_common_reference.hpp:12
Definition integral_constant.hpp:9
etl::pair is a class template that provides a way to store two heterogeneous objects as a single unit...
Definition pair.hpp:36
U2 && y
Definition pair.hpp:65
T2 const & t2
Definition pair.hpp:56
U2 const & p
Definition pair.hpp:76
TETL_NO_UNIQUE_ADDRESS T2 second
Definition pair.hpp:135
constexpr auto operator=(pair &&p) noexcept -> pair &requires((is_move_assignable_v< first_type > and is_move_assignable_v< second_type >))
Definition pair.hpp:110
T1 first_type
Definition pair.hpp:37
TETL_NO_UNIQUE_ADDRESS T1 first
Definition pair.hpp:134
constexpr auto swap(pair &other) noexcept(is_nothrow_swappable_v< first_type > and is_nothrow_swappable_v< second_type >) -> void
Definition pair.hpp:126
constexpr pair(pair const &p)=default
Copy constructor is defaulted, and is constexpr if copying of both elements satisfies the requirement...
T2 second_type
Definition pair.hpp:38
~pair() noexcept=default
Defaulted destructor.
constexpr pair(pair &&p) noexcept=default
Move constructor is defaulted, and is constexpr if moving of both elements satisfies the requirements...
conditional_t< I==0, T1, T2 > type
Definition pair.hpp:234
Provides compile-time indexed access to the type of the elements of the array using tuple-like interf...
Definition array.hpp:267
Definition tuple_size.hpp:15