|
|
constexpr | compressed_pair () noexcept(conjunction_v< is_nothrow_default_constructible< IfEmpty >, is_nothrow_default_constructible< T > >)=default |
| | 默认构造函数
|
| constexpr | compressed_pair (const compressed_pair &pir) noexcept(conjunction_v< is_nothrow_copy_constructible< IfEmpty >, is_nothrow_copy_constructible< T > >) |
| | 拷贝构造函数
|
| constexpr compressed_pair & | operator= (const compressed_pair &pir) noexcept(conjunction_v< is_nothrow_copy_assignable< IfEmpty >, is_nothrow_copy_assignable< T > >) |
| | 拷贝赋值运算符
|
| constexpr | compressed_pair (compressed_pair &&pir) noexcept(conjunction_v< is_nothrow_move_constructible< IfEmpty >, is_nothrow_move_constructible< T > >) |
| | 移动构造函数
|
| constexpr compressed_pair & | operator= (compressed_pair &&pir) noexcept(conjunction_v< is_nothrow_move_assignable< IfEmpty >, is_nothrow_move_assignable< T > >) |
| | 移动赋值运算符
|
| template<typename... Args> |
| constexpr | compressed_pair (default_construct_tag, Args &&... args) noexcept(conjunction_v< is_nothrow_default_constructible< IfEmpty >, is_nothrow_constructible< T, Args... > >) |
| | 默认构造标签构造函数
|
| template<typename ToEmpty, typename... Args> |
| 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 IfEmpty & | get_base () noexcept |
| | 获取基类引用
|
| constexpr const IfEmpty & | get_base () const noexcept |
| | 获取基类常量引用
|
| constexpr void | swap (compressed_pair &rhs) noexcept(conjunction_v< is_nothrow_swappable< IfEmpty >, is_nothrow_swappable< T > >) |
| | 交换两个压缩对
|
| constexpr size_t | to_hash () const noexcept(noexcept(hash< IfEmpty >{}(no_compressed) ^ hash< T >{}(value))) |
| | 计算哈希值
|
| constexpr bool | operator== (const compressed_pair &y) const noexcept(noexcept(this->no_compressed==y.no_compressed &&this->value==y.value)) |
| | 相等比较运算符
|
| 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))) |
| | 小于比较运算符
|
| MSTL_NODISCARD constexpr bool | operator== (const T &rhs) const noexcept(noexcept(derived()==rhs)) |
| | 相等比较运算符
|
| MSTL_NODISCARD constexpr bool | operator!= (const T &rhs) const noexcept(noexcept(!(*this==rhs))) |
| | 不等比较运算符
|
| MSTL_NODISCARD constexpr bool | operator< (const T &rhs) const noexcept(noexcept(derived()< rhs)) |
| | 小于比较运算符
|
| MSTL_NODISCARD constexpr bool | operator> (const T &rhs) const noexcept(noexcept(rhs< derived())) |
| | 大于比较运算符
|
| MSTL_NODISCARD constexpr bool | operator<= (const T &rhs) const noexcept(noexcept(!(derived() > rhs))) |
| | 小于等于比较运算符
|
| MSTL_NODISCARD constexpr bool | operator>= (const T &rhs) const noexcept(noexcept(!(derived()< rhs))) |
| | 大于等于比较运算符
|
| MSTL_NODISCARD constexpr size_t | to_hash () const noexcept(noexcept(derived().to_hash())) |
| | 获取对象的哈希值
|
template<typename IfEmpty, typename T>
struct compressed_pair< IfEmpty, T, false >
压缩对特化,未启用EBCO优化
- 模板参数
-
当第一个类型不为空或是final类时,不使用EBCO优化,正常存储两个成员。
在文件 compressed_pair.hpp 第 168 行定义.