44 template <
typename T1,
typename T2>
45 class pair :
public i_pair<abstract_t<T1>, abstract_t<T2>>,
public std::pair<T1, T2>
56 typedef std::pair<first_type, second_type> concrete_type;
60 pair(
const concrete_type& aPair) : concrete_type{ aPair } {}
61 template <
typename T3,
typename T4>
62 pair(T3&& aFirst, T4&& aSecond) : concrete_type{
std::forward<T3>(aFirst),
std::forward<T4>(aSecond) } {}
74 if constexpr (!std::is_const_v<first_type> && !std::is_const_v<second_type>)
80 throw std::logic_error(
"neolib::pair isn't assignable (const value_type)");
92 return first() == that.first() &&
second() == that.second();
97 return std::partial_ordering::equivalent;
98 else if (std::forward_as_tuple(
first(),
second()) < std::forward_as_tuple(that.first(), that.second()))
99 return std::partial_ordering::less;
101 return std::partial_ordering::greater;
105 template <
typename T1,
typename T2>
108 return pair<std::decay_t<T1>, std::decay_t<T2>>{ std::forward<T1>(aFirst), std::forward<T2>(aSecond) };
virtual const second_type & second() const =0
virtual const first_type & first() const =0
abstract_type & operator=(const abstract_type &aOther) final
first_type & first() final
abstract_t< T2 > second_abstract_type
pair(const abstract_type &aPair)
constexpr bool operator==(const self_type &that) const noexcept
second_type & second() final
self_type & assign(const abstract_type &aOther)
constexpr std::partial_ordering operator<=>(const self_type &that) const noexcept
const second_type & second() const final
const first_type & first() const final
friend void swap(self_type &a, self_type &b)
self_type & operator=(const self_type &aOther)
pair(T3 &&aFirst, T4 &&aSecond)
abstract_t< T1 > first_abstract_type
pair(const concrete_type &aPair)
typename detail::abstract_type< T >::type abstract_t
pair< std::decay_t< T1 >, std::decay_t< T2 > > make_pair(T1 &&aFirst, T2 &&aSecond)
void swap(plf::hive< element_type, allocator_type > &a, plf::hive< element_type, allocator_type > &b) noexcept(std::allocator_traits< allocator_type >::propagate_on_container_swap::value||std::allocator_traits< allocator_type >::is_always_equal::value)