1#ifndef NEFORCE_CORE_UTILITY_COMPRESSED_PAIR_HPP__
2#define NEFORCE_CORE_UTILITY_COMPRESSED_PAIR_HPP__
13NEFORCE_BEGIN_NAMESPACE__
30template <
typename IfEmpty,
typename T,
bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
98 template <
typename ToEmpty,
typename... Args,
102 IfEmpty(_NEFORCE
forward<ToEmpty>(first)),
135 return this->
value == y.value;
144 return this->
value < y.value;
156template <
typename IfEmpty,
typename T>
216 template <
typename... Args>
229 template <
typename ToEmpty,
typename... Args>
262 return hash<IfEmpty>{}(no_compressed) ^ hash<T>{}(
value);
271 noexcept(
noexcept(this->
no_compressed == y.no_compressed && this->
value == y.value)) {
288#ifdef NEFORCE_STANDARD_17
289template <
typename IfEmpty,
typename T>
295NEFORCE_END_NAMESPACE__
NEFORCE_NODISCARD constexpr T && forward(remove_reference_t< T > &x) noexcept
完美转发左值
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result) noexcept(noexcept(inner::__move_aux(first, last, result)))
移动范围元素
void swap()=delete
删除无参数的swap重载
NEFORCE_INLINE17 constexpr bool is_nothrow_swappable_v
is_nothrow_swappable的便捷变量模板
NEFORCE_INLINE17 constexpr bool is_nothrow_default_constructible_v
is_nothrow_default_constructible的便捷变量模板
NEFORCE_INLINE17 constexpr bool is_nothrow_copy_assignable_v
is_nothrow_copy_assignable的便捷变量模板
NEFORCE_INLINE17 constexpr bool is_nothrow_move_assignable_v
is_nothrow_move_assignable的便捷变量模板
NEFORCE_INLINE17 constexpr bool is_constructible_v
is_constructible的便捷变量模板
NEFORCE_INLINE17 constexpr bool is_nothrow_move_constructible_v
is_nothrow_move_constructible的便捷变量模板
NEFORCE_INLINE17 constexpr bool is_nothrow_copy_constructible_v
is_nothrow_copy_constructible的便捷变量模板
NEFORCE_INLINE17 constexpr bool conjunction_v
conjunction的便捷变量模板
typename enable_if< Test, T >::type enable_if_t
enable_if的便捷别名
constexpr const IfEmpty & get_base() const noexcept
获取基类常量引用
constexpr compressed_pair() noexcept(conjunction_v< is_nothrow_default_constructible< IfEmpty >, is_nothrow_default_constructible< T > >)
默认构造函数
constexpr void swap(compressed_pair &rhs) noexcept(conjunction_v< is_nothrow_swappable< IfEmpty >, is_nothrow_swappable< T > >)
交换两个压缩对
constexpr compressed_pair(const compressed_pair &pir) noexcept(conjunction_v< is_nothrow_copy_constructible< IfEmpty >, is_nothrow_copy_constructible< T > >)
拷贝构造函数
constexpr compressed_pair(default_construct_tag, Args &&... args) noexcept(conjunction_v< is_nothrow_default_constructible< IfEmpty >, is_nothrow_constructible< T, Args... > >)
默认构造标签构造函数
constexpr compressed_pair(compressed_pair &&pir) noexcept(conjunction_v< is_nothrow_move_constructible< IfEmpty >, is_nothrow_move_constructible< T > >)
移动构造函数
constexpr size_t to_hash() const noexcept(noexcept(hash< IfEmpty >{}(no_compressed) ^ hash< T >{}(value)))
计算哈希值
constexpr compressed_pair(exact_arg_construct_tag, ToEmpty &&first, Args &&... args) noexcept(conjunction_v< is_nothrow_constructible< IfEmpty, ToEmpty >, is_nothrow_constructible< T, Args... > >)
精确参数构造标签构造函数
constexpr compressed_pair & operator=(compressed_pair &&pir) noexcept(conjunction_v< is_nothrow_move_assignable< IfEmpty >, is_nothrow_move_assignable< T > >)
移动赋值运算符
constexpr bool operator==(const compressed_pair &y) const noexcept(noexcept(this->no_compressed==y.no_compressed &&this->value==y.value))
相等比较运算符
IfEmpty no_compressed
未压缩的基类成员
constexpr compressed_pair & operator=(const compressed_pair &pir) noexcept(conjunction_v< is_nothrow_copy_assignable< IfEmpty >, is_nothrow_copy_assignable< T > >)
拷贝赋值运算符
constexpr IfEmpty & get_base() noexcept
获取基类引用
constexpr bool operator<(const compressed_pair &y) const noexcept(noexcept(this->no_compressed< y.no_compressed||(!(y.no_compressed< this->no_compressed) &&this->value< y.value)))
小于比较运算符
constexpr compressed_pair() noexcept(is_nothrow_default_constructible_v< T >)
默认构造函数
constexpr void swap(compressed_pair &rhs) noexcept(is_nothrow_swappable_v< T >)
交换两个压缩对
constexpr compressed_pair(compressed_pair &&p) noexcept(is_nothrow_move_constructible_v< T >)
移动构造函数
constexpr compressed_pair(default_construct_tag, Args &&... args) noexcept(conjunction_v< is_nothrow_default_constructible< IfEmpty >, is_nothrow_constructible< T, Args... > >)
默认构造标签构造函数
constexpr bool operator<(const compressed_pair &y) const noexcept(noexcept(this->value< y.value))
小于比较运算符
constexpr bool operator==(const compressed_pair &y) const noexcept(noexcept(this->value==y.value))
相等比较运算符
constexpr compressed_pair & operator=(compressed_pair &&pir) noexcept(is_nothrow_move_assignable_v< T >)
移动赋值运算符
constexpr compressed_pair & operator=(const compressed_pair &pir) noexcept(is_nothrow_copy_assignable_v< T >)
拷贝赋值运算符
constexpr compressed_pair & get_base() noexcept
获取基类引用
constexpr const compressed_pair & get_base() const noexcept
获取基类常量引用
constexpr compressed_pair(exact_arg_construct_tag, ToEmpty &&first, Args &&... args) noexcept(conjunction_v< is_nothrow_constructible< IfEmpty, ToEmpty >, is_nothrow_constructible< T, Args... > >)
精确参数构造标签构造函数
constexpr compressed_pair(const compressed_pair &p) noexcept(is_nothrow_copy_constructible_v< T >)
拷贝构造函数
constexpr size_t to_hash() const noexcept(noexcept(hash< T >{}(value)))
计算哈希值