NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
compressed_pair< IfEmpty, T, Compressed > 模板结构体 参考final

压缩对主模板,使用EBCO优化 更多...

#include <compressed_pair.hpp>

类 compressed_pair< IfEmpty, T, Compressed > 继承关系图:
[图例]

Public 类型

using base_type = IfEmpty
 基类类型

Public 成员函数

constexpr compressed_pair () noexcept(is_nothrow_default_constructible_v< T >)
 默认构造函数
constexpr compressed_pair (const compressed_pair &p) noexcept(is_nothrow_copy_constructible_v< T >)
 拷贝构造函数
constexpr compressed_pairoperator= (const compressed_pair &pir) noexcept(is_nothrow_copy_assignable_v< T >)
 拷贝赋值运算符
constexpr compressed_pair (compressed_pair &&p) noexcept(is_nothrow_move_constructible_v< T >)
 移动构造函数
constexpr compressed_pairoperator= (compressed_pair &&pir) noexcept(is_nothrow_move_assignable_v< T >)
 移动赋值运算符
template<typename... Args, enable_if_t< is_constructible_v< T, Args... >, int > = 0>
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, enable_if_t< conjunction_v< is_constructible< IfEmpty, ToEmpty >, is_constructible< T, Args... > >, int > = 0>
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_pairget_base () &noexcept
 获取基类引用
constexpr const compressed_pairget_base () const &noexcept
 获取基类常量引用
constexpr compressed_pair && get_base () &&noexcept
 获取基类引用
constexpr const compressed_pair && get_base () const &&noexcept
 获取基类常量引用
constexpr void swap (compressed_pair &rhs) noexcept(is_nothrow_swappable_v< T >)
 交换两个压缩对
constexpr size_t to_hash () const noexcept(noexcept(hash< T >{}(value)))
 计算哈希值
constexpr bool equal_to (const compressed_pair &y) const noexcept(noexcept(this->value==y.value))
 相等比较运算符
constexpr bool less_than (const compressed_pair &y) const noexcept(noexcept(this->value< y.value))
 小于比较运算符
Public 成员函数 继承自 icomparable< T >
constexpr bool operator== (const T &rhs) const noexcept(noexcept(derived().equal_to(rhs)))
 相等比较运算符
constexpr bool operator!= (const T &rhs) const noexcept(noexcept(!(derived().equal_to(rhs))))
 不等比较运算符
constexpr bool operator< (const T &rhs) const noexcept(noexcept(derived().less_than(rhs)))
 小于比较运算符
constexpr bool operator> (const T &rhs) const noexcept(noexcept(rhs.less_than(derived())))
 大于比较运算符
constexpr bool operator<= (const T &rhs) const noexcept(noexcept(!(rhs.less_than(derived()))))
 小于等于比较运算符
constexpr bool operator>= (const T &rhs) const noexcept(noexcept(!(derived().less_than(rhs))))
 大于等于比较运算符
Public 成员函数 继承自 ihashable< T >
constexpr size_t to_ihash () const noexcept(noexcept(derived().to_hash()))
 获取对象的哈希值

Public 属性

value
 存储的值

详细描述

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
struct compressed_pair< IfEmpty, T, Compressed >

压缩对主模板,使用EBCO优化

模板参数
IfEmpty第一个类型,可能为空
T第二个类型
Compressed是否启用压缩

使用空基类优化技术,当第一个类型为空时,通过继承来优化存储空间。

在文件 compressed_pair.hpp31 行定义.

构造及析构函数说明

◆ compressed_pair() [1/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
compressed_pair< IfEmpty, T, Compressed >::compressed_pair ( const compressed_pair< IfEmpty, T, Compressed > & p)
inlineconstexprnoexcept

拷贝构造函数

参数
p要拷贝的压缩对

在文件 compressed_pair.hpp47 行定义.

引用了 compressed_pair(), get_base(), is_nothrow_copy_constructible_v , 以及 value.

◆ compressed_pair() [2/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
compressed_pair< IfEmpty, T, Compressed >::compressed_pair ( compressed_pair< IfEmpty, T, Compressed > && p)
inlineconstexprnoexcept

移动构造函数

参数
p要移动的压缩对

在文件 compressed_pair.hpp65 行定义.

引用了 compressed_pair(), get_base(), is_nothrow_move_constructible_v, move() , 以及 value.

◆ compressed_pair() [3/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
template<typename... Args, enable_if_t< is_constructible_v< T, Args... >, int > = 0>
compressed_pair< IfEmpty, T, Compressed >::compressed_pair ( default_construct_tag ,
Args &&... args )
inlineexplicitconstexprnoexcept

默认构造标签构造函数

模板参数
Args参数类型
参数
args构造参数

使用默认构造的基类和给定的参数构造值。

在文件 compressed_pair.hpp87 行定义.

引用了 conjunction_v, forward() , 以及 value.

◆ compressed_pair() [4/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
template<typename ToEmpty, typename... Args, enable_if_t< conjunction_v< is_constructible< IfEmpty, ToEmpty >, is_constructible< T, Args... > >, int > = 0>
compressed_pair< IfEmpty, T, Compressed >::compressed_pair ( exact_arg_construct_tag ,
ToEmpty && first,
Args &&... args )
inlineexplicitconstexprnoexcept

精确参数构造标签构造函数

模板参数
ToEmpty基类参数类型
Args值参数类型
参数
first基类构造参数
args值构造参数

使用给定的参数构造基类和值。

在文件 compressed_pair.hpp103 行定义.

引用了 conjunction_v, forward() , 以及 value.

成员函数说明

◆ equal_to()

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
bool compressed_pair< IfEmpty, T, Compressed >::equal_to ( const compressed_pair< IfEmpty, T, Compressed > & y) const
inlinenodiscardconstexprnoexcept

相等比较运算符

参数
y要比较的压缩对
返回
如果值相等返回true,否则返回false

在文件 compressed_pair.hpp149 行定义.

引用了 compressed_pair() , 以及 value.

◆ get_base() [1/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
compressed_pair && compressed_pair< IfEmpty, T, Compressed >::get_base ( ) &&
inlineconstexprnoexcept

获取基类引用

返回
基类的引用

在文件 compressed_pair.hpp124 行定义.

引用了 compressed_pair() , 以及 move().

◆ get_base() [2/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
compressed_pair & compressed_pair< IfEmpty, T, Compressed >::get_base ( ) &
inlineconstexprnoexcept

◆ get_base() [3/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
const compressed_pair && compressed_pair< IfEmpty, T, Compressed >::get_base ( ) const &&
inlineconstexprnoexcept

获取基类常量引用

返回
基类的常量引用

在文件 compressed_pair.hpp130 行定义.

引用了 compressed_pair() , 以及 move().

◆ get_base() [4/4]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
const compressed_pair & compressed_pair< IfEmpty, T, Compressed >::get_base ( ) const &
inlineconstexprnoexcept

获取基类常量引用

返回
基类的常量引用

在文件 compressed_pair.hpp118 行定义.

引用了 compressed_pair().

◆ less_than()

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
bool compressed_pair< IfEmpty, T, Compressed >::less_than ( const compressed_pair< IfEmpty, T, Compressed > & y) const
inlinenodiscardconstexprnoexcept

小于比较运算符

参数
y要比较的压缩对
返回
如果当前值小于另一个值返回true,否则返回false

在文件 compressed_pair.hpp159 行定义.

引用了 compressed_pair() , 以及 value.

◆ operator=() [1/2]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
compressed_pair & compressed_pair< IfEmpty, T, Compressed >::operator= ( compressed_pair< IfEmpty, T, Compressed > && pir)
inlineconstexprnoexcept

移动赋值运算符

参数
pir要移动的压缩对
返回
当前压缩对的引用

在文件 compressed_pair.hpp74 行定义.

引用了 compressed_pair(), is_nothrow_move_assignable_v, move() , 以及 value.

◆ operator=() [2/2]

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
compressed_pair & compressed_pair< IfEmpty, T, Compressed >::operator= ( const compressed_pair< IfEmpty, T, Compressed > & pir)
inlineconstexprnoexcept

拷贝赋值运算符

参数
pir要拷贝的压缩对
返回
当前压缩对的引用

在文件 compressed_pair.hpp56 行定义.

引用了 compressed_pair(), is_nothrow_copy_assignable_v, move() , 以及 value.

◆ swap()

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
void compressed_pair< IfEmpty, T, Compressed >::swap ( compressed_pair< IfEmpty, T, Compressed > & rhs)
inlineconstexprnoexcept

交换两个压缩对

参数
rhs要交换的压缩对

在文件 compressed_pair.hpp136 行定义.

引用了 compressed_pair(), is_nothrow_swappable_v, swap() , 以及 value.

被这些函数引用 swap().

◆ to_hash()

template<typename IfEmpty, typename T, bool Compressed = is_empty_v<IfEmpty> && !is_final_v<IfEmpty>>
size_t compressed_pair< IfEmpty, T, Compressed >::to_hash ( ) const
inlineconstexprnoexcept

计算哈希值

返回
值的哈希值

在文件 compressed_pair.hpp142 行定义.


该结构体的文档由以下文件生成: