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

元组主模板 更多...

#include <tuple.hpp>

类 tuple< This, Rest... > 继承关系图:
[图例]

Public 类型

using this_type = This
 当前元素类型
using base_type = tuple<Rest...>
 基类类型,即剩余元素的元组

Public 成员函数

template<typename Tag, typename U1, typename... U2, enable_if_t< is_same< Tag, exact_arg_construct_tag >::value, int > = 0>
constexpr tuple (Tag, U1 &&this_arg, U2 &&... rest_arg)
 精确参数构造函数
template<typename Tag, typename Tuple, size_t... Index, enable_if_t< is_same< Tag, unpack_utility_construct_tag >::value, int > = 0>
constexpr tuple (Tag, Tuple &&tup, index_sequence< Index... > idx)
 解包工具构造函数
template<typename Tag, typename Tuple, enable_if_t< is_same< Tag, unpack_utility_construct_tag >::value, int > = 0>
constexpr tuple (Tag, Tuple &&tup)
 解包工具构造函数
template<typename T = This, enable_if_t< conjunction_v< is_default_constructible< T >, is_default_constructible< Rest >... >, int > = 0>
constexpr explicit (!conjunction_v< is_implicitly_default_constructible< T >, is_implicitly_default_constructible< Rest >... >) tuple() noexcept(conjunction_v< is_nothrow_default_constructible< T >, is_nothrow_default_constructible< Rest >... >)
 默认构造函数
template<typename T = This, enable_if_t< inner::tuple_constructible< tuple, const T &, const Rest &... >::value, int > = 0>
constexpr explicit (inner::tuple_explicitly_convertible< tuple, const T &, const Rest &... >::value) tuple(const T &this_arg
 拷贝构造函数
template<typename U1, typename... U2, enable_if_t< conjunction_v< inner::tuple_perfect_forward< tuple, U1, U2... >, inner::tuple_constructible< tuple, U1, U2... > >, int > = 0>
constexpr explicit (inner::tuple_explicitly_convertible< tuple, U1, U2... >::value) tuple(U1 &&this_arg
 完美转发构造函数
template<typename... U, enable_if_t< conjunction_v< inner::tuple_constructible< tuple, const U &... >, inner::tuple_convertible< tuple, const tuple< U... > &, U... > >, int > = 0>
constexpr explicit (inner::tuple_explicitly_convertible< tuple, const U &... >::value) tuple(const tuple< U... > &tup) noexcept(inner::tuple_nothrow_constructible< tuple, const U &... >::value)
 从其他元组拷贝构造
template<typename... U, enable_if_t< conjunction_v< inner::tuple_constructible< tuple, U... >, inner::tuple_convertible< tuple, tuple< U... >, U... > >, int > = 0>
constexpr explicit (inner::tuple_explicitly_convertible< tuple, U... >::value) tuple(tuple< U... > &&tup) noexcept(inner::tuple_nothrow_constructible< tuple, U... >::value)
 从其他元组移动构造
template<typename T1, typename T2, enable_if_t< inner::tuple_constructible< tuple, const T1 &, const T2 & >::value, int > = 0>
constexpr explicit (inner::tuple_explicitly_convertible< tuple, const T1 &, const T2 & >::value) tuple(const pair< T1
 从pair拷贝构造
template<typename T1, typename T2, enable_if_t< inner::tuple_constructible< tuple, T1, T2 >::value, int > = 0>
constexpr explicit (inner::tuple_explicitly_convertible< tuple, T1, T2 >::value) tuple(pair< T1
 从pair移动构造
 tuple (const tuple &)=default
 拷贝构造函数
 tuple (tuple &&)=default
 移动构造函数
template<typename T = This, enable_if_t< conjunction< is_copy_assignable< T >, is_copy_assignable< Rest >... >::value, int > = 0>
NEFORCE_CONSTEXPR14 tupleoperator= (type_identity_t< const tuple & > tup) noexcept(conjunction< is_nothrow_copy_assignable< T >, is_nothrow_copy_assignable< Rest >... >::value)
 拷贝赋值运算符
template<typename T = This, enable_if_t< conjunction< is_move_assignable< T >, is_move_assignable< Rest >... >::value, int > = 0>
NEFORCE_CONSTEXPR14 tupleoperator= (type_identity_t< tuple && > tup) noexcept(conjunction< is_nothrow_move_assignable< T >, is_nothrow_move_assignable< Rest >... >::value)
 移动赋值运算符
template<typename... U, enable_if_t< conjunction< negation< is_same< tuple, tuple< U... > > >, inner::tuple_assignable< tuple, const U &... > >::value, int > = 0>
NEFORCE_CONSTEXPR14 tupleoperator= (const tuple< U... > &tup) noexcept(inner::tuple_nothrow_assignable< tuple, const U &... >::value)
 从其他元组拷贝赋值
template<typename... U, enable_if_t< conjunction< negation< is_same< tuple, tuple< U... > > >, inner::tuple_assignable< tuple, U... > >::value, int > = 0>
NEFORCE_CONSTEXPR14 tupleoperator= (tuple< U... > &&tup) noexcept(inner::tuple_nothrow_assignable< tuple, U... >::value)
 从其他元组移动赋值
template<typename T1, typename T2, enable_if_t< inner::tuple_assignable< tuple, const T1 &, const T2 & >::value, int > = 0>
NEFORCE_CONSTEXPR14 tupleoperator= (const pair< T1, T2 > &pir) noexcept(inner::tuple_nothrow_assignable< tuple, const T1 &, const T2 & >::value)
 从pair拷贝赋值
template<typename T1, typename T2, enable_if_t< inner::tuple_assignable< tuple, T1, T2 >::value, int > = 0>
NEFORCE_CONSTEXPR14 tupleoperator= (pair< T1, T2 > &&pir) noexcept(inner::tuple_nothrow_assignable< tuple, T1, T2 >::value)
 从pair移动赋值
tupleoperator= (const volatile tuple &)=delete
 禁止volatile拷贝赋值
NEFORCE_CONSTEXPR14 base_typeget_rest () noexcept
 获取剩余元素的元组引用
NEFORCE_CONSTEXPR14 const base_typeget_rest () const noexcept
 获取剩余元素的元组常量引用
template<typename... U>
NEFORCE_NODISCARD constexpr bool equal_to (const tuple< U... > &t) const
 比较两个元组是否相等
template<typename... U>
NEFORCE_NODISCARD constexpr bool less_to (const tuple< U... > &rhs) const
 比较两个元组的大小关系
NEFORCE_NODISCARD constexpr bool operator== (const tuple &rhs) const noexcept
 相等比较运算符
NEFORCE_NODISCARD constexpr bool operator< (const tuple &rhs) const noexcept
 小于比较运算符
NEFORCE_NODISCARD constexpr size_t to_hash () const noexcept
 计算元组的哈希值
NEFORCE_CONSTEXPR14 void swap (tuple &t) noexcept(conjunction< is_nothrow_swappable< This >, is_nothrow_swappable< Rest >... >::value)
 交换两个元组的内容
Public 成员函数 继承自 icomparable< tuple< This, Rest... > >
NEFORCE_NODISCARD constexpr bool operator== (const tuple< This, Rest... > &rhs) const noexcept(noexcept(derived()==rhs))
 相等比较运算符
NEFORCE_NODISCARD constexpr bool operator!= (const tuple< This, Rest... > &rhs) const noexcept(noexcept(!(*this==rhs)))
 不等比较运算符
NEFORCE_NODISCARD constexpr bool operator< (const tuple< This, Rest... > &rhs) const noexcept(noexcept(derived()< rhs))
 小于比较运算符
NEFORCE_NODISCARD constexpr bool operator> (const tuple< This, Rest... > &rhs) const noexcept(noexcept(rhs< derived()))
 大于比较运算符
NEFORCE_NODISCARD constexpr bool operator<= (const tuple< This, Rest... > &rhs) const noexcept(noexcept(!(derived() > rhs)))
 小于等于比较运算符
NEFORCE_NODISCARD constexpr bool operator>= (const tuple< This, Rest... > &rhs) const noexcept(noexcept(!(derived()< rhs)))
 大于等于比较运算符
Public 成员函数 继承自 ihashable< tuple< This, Rest... > >
NEFORCE_NODISCARD constexpr size_t to_hash () const noexcept(noexcept(derived().to_hash()))
 获取对象的哈希值

详细描述

template<typename This, typename... Rest>
struct tuple< This, Rest... >

元组主模板

模板参数
This第一个元素类型
Rest剩余元素类型

使用递归继承实现元组,每个元组包含当前元素和继承自剩余元素的元组。

在文件 tuple.hpp232 行定义.

构造及析构函数说明

◆ tuple() [1/3]

template<typename This, typename... Rest>
template<typename Tag, typename U1, typename... U2, enable_if_t< is_same< Tag, exact_arg_construct_tag >::value, int > = 0>
tuple< This, Rest... >::tuple ( Tag ,
U1 && this_arg,
U2 &&... rest_arg )
inlineconstexpr

精确参数构造函数

模板参数
Tag标签类型
U1第一个参数类型
U2剩余参数类型
参数
this_arg第一个元素参数
rest_arg剩余元素参数

在文件 tuple.hpp261 行定义.

引用了 forward().

被这些函数引用 equal_to(), explicit(), explicit(), explicit(), explicit(), explicit(), explicit(), explicit(), get, get, get, get, less_to(), operator<(), operator=(), operator=(), operator=(), operator=(), operator=(), operator==(), swap(), tuple(), tuple() , 以及 tuple().

◆ tuple() [2/3]

template<typename This, typename... Rest>
template<typename Tag, typename Tuple, size_t... Index, enable_if_t< is_same< Tag, unpack_utility_construct_tag >::value, int > = 0>
tuple< This, Rest... >::tuple ( Tag ,
Tuple && tup,
index_sequence< Index... > idx )
constexpr

解包工具构造函数

模板参数
Tag标签类型
Tuple源元组类型
Index索引序列
参数
tup源元组
idx索引序列

◆ tuple() [3/3]

template<typename This, typename... Rest>
template<typename Tag, typename Tuple, enable_if_t< is_same< Tag, unpack_utility_construct_tag >::value, int > = 0>
tuple< This, Rest... >::tuple ( Tag ,
Tuple && tup )
inlineconstexpr

解包工具构造函数

模板参数
Tag标签类型
Tuple源元组类型
参数
tup源元组

在文件 tuple.hpp284 行定义.

引用了 forward() , 以及 tuple().

成员函数说明

◆ equal_to()

template<typename This, typename... Rest>
template<typename... U>
NEFORCE_NODISCARD constexpr bool tuple< This, Rest... >::equal_to ( const tuple< U... > & t) const
inlineconstexpr

比较两个元组是否相等

模板参数
U其他元组元素类型
参数
t其他元组
返回
如果所有对应元素相等则返回true,否则返回false

在文件 tuple.hpp610 行定义.

引用了 tuple().

被这些函数引用 operator==().

◆ explicit() [1/7]

template<typename This, typename... Rest>
template<typename T = This, enable_if_t< conjunction_v< is_default_constructible< T >, is_default_constructible< Rest >... >, int > = 0>
tuple< This, Rest... >::explicit ( !conjunction_v< is_implicitly_default_constructible< T >, is_implicitly_default_constructible< Rest >... > )
inlineconstexprnoexcept

默认构造函数

模板参数
T当前元素类型

在文件 tuple.hpp296 行定义.

引用了 conjunction_v , 以及 tuple().

◆ explicit() [2/7]

template<typename This, typename... Rest>
template<typename T = This, enable_if_t< inner::tuple_constructible< tuple, const T &, const Rest &... >::value, int > = 0>
tuple< This, Rest... >::explicit ( inner::tuple_explicitly_convertible< tuple< This, Rest... >, const T &, const Rest &... >::value ) const &
constexpr

拷贝构造函数

模板参数
T当前元素类型
参数
this_arg第一个元素
rest_arg剩余元素

引用了 conjunction_v , 以及 tuple().

◆ explicit() [3/7]

template<typename This, typename... Rest>
template<typename T1, typename T2, enable_if_t< inner::tuple_constructible< tuple, const T1 &, const T2 & >::value, int > = 0>
tuple< This, Rest... >::explicit ( inner::tuple_explicitly_convertible< tuple< This, Rest... >, const T1 &, const T2 & >::value ) const
constexpr

从pair拷贝构造

模板参数
T1第一个元素类型
T2第二个元素类型
参数
pir源pair

引用了 tuple().

◆ explicit() [4/7]

template<typename This, typename... Rest>
template<typename... U, enable_if_t< conjunction_v< inner::tuple_constructible< tuple, const U &... >, inner::tuple_convertible< tuple, const tuple< U... > &, U... > >, int > = 0>
tuple< This, Rest... >::explicit ( inner::tuple_explicitly_convertible< tuple< This, Rest... >, const U &... >::value ) const &
inlineconstexprnoexcept

从其他元组拷贝构造

模板参数
U源元组元素类型
参数
tup源元组

在文件 tuple.hpp340 行定义.

引用了 tuple().

◆ explicit() [5/7]

template<typename This, typename... Rest>
template<typename T1, typename T2, enable_if_t< inner::tuple_constructible< tuple, T1, T2 >::value, int > = 0>
tuple< This, Rest... >::explicit ( inner::tuple_explicitly_convertible< tuple< This, Rest... >, T1, T2 >::value )
constexpr

从pair移动构造

模板参数
T1第一个元素类型
T2第二个元素类型
参数
pir源pair

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

◆ explicit() [6/7]

template<typename This, typename... Rest>
template<typename... U, enable_if_t< conjunction_v< inner::tuple_constructible< tuple, U... >, inner::tuple_convertible< tuple, tuple< U... >, U... > >, int > = 0>
tuple< This, Rest... >::explicit ( inner::tuple_explicitly_convertible< tuple< This, Rest... >, U... >::value ) &&
inlineconstexprnoexcept

从其他元组移动构造

模板参数
U源元组元素类型
参数
tup源元组

在文件 tuple.hpp352 行定义.

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

◆ explicit() [7/7]

template<typename This, typename... Rest>
template<typename U1, typename... U2, enable_if_t< conjunction_v< inner::tuple_perfect_forward< tuple, U1, U2... >, inner::tuple_constructible< tuple, U1, U2... > >, int > = 0>
tuple< This, Rest... >::explicit ( inner::tuple_explicitly_convertible< tuple< This, Rest... >, U1, U2... >::value ) &&
constexpr

完美转发构造函数

模板参数
U1第一个参数类型
U2剩余参数类型
参数
this_arg第一个元素参数
rest_arg剩余元素参数

引用了 forward() , 以及 tuple().

◆ get_rest() [1/2]

template<typename This, typename... Rest>
NEFORCE_CONSTEXPR14 const base_type & tuple< This, Rest... >::get_rest ( ) const
inlinenoexcept

获取剩余元素的元组常量引用

返回
基类元组的常量引用

在文件 tuple.hpp601 行定义.

◆ get_rest() [2/2]

template<typename This, typename... Rest>
NEFORCE_CONSTEXPR14 base_type & tuple< This, Rest... >::get_rest ( )
inlinenoexcept

获取剩余元素的元组引用

返回
基类元组的引用

在文件 tuple.hpp595 行定义.

被这些函数引用 operator=(), operator=(), operator=(), operator=(), operator=() , 以及 operator=().

◆ less_to()

template<typename This, typename... Rest>
template<typename... U>
NEFORCE_NODISCARD constexpr bool tuple< This, Rest... >::less_to ( const tuple< U... > & rhs) const
inlineconstexpr

比较两个元组的大小关系

模板参数
U其他元组元素类型
参数
rhs其他元组
返回
如果当前元组小于其他元组则返回true,否则返回false

在文件 tuple.hpp621 行定义.

引用了 tuple().

被这些函数引用 operator<().

◆ operator=() [1/6]

template<typename This, typename... Rest>
template<typename T1, typename T2, enable_if_t< inner::tuple_assignable< tuple, const T1 &, const T2 & >::value, int > = 0>
NEFORCE_CONSTEXPR14 tuple & tuple< This, Rest... >::operator= ( const pair< T1, T2 > & pir)
inlinenoexcept

从pair拷贝赋值

模板参数
T1第一个元素类型
T2第二个元素类型
参数
pir源pair
返回
当前元组的引用

在文件 tuple.hpp568 行定义.

引用了 get_rest().

◆ operator=() [2/6]

template<typename This, typename... Rest>
template<typename... U, enable_if_t< conjunction< negation< is_same< tuple, tuple< U... > > >, inner::tuple_assignable< tuple, const U &... > >::value, int > = 0>
NEFORCE_CONSTEXPR14 tuple & tuple< This, Rest... >::operator= ( const tuple< U... > & tup)
inlinenoexcept

从其他元组拷贝赋值

模板参数
U源元组元素类型
参数
tup源元组
返回
当前元组的引用

在文件 tuple.hpp535 行定义.

引用了 get_rest() , 以及 tuple().

◆ operator=() [3/6]

template<typename This, typename... Rest>
template<typename T1, typename T2, enable_if_t< inner::tuple_assignable< tuple, T1, T2 >::value, int > = 0>
NEFORCE_CONSTEXPR14 tuple & tuple< This, Rest... >::operator= ( pair< T1, T2 > && pir)
inlinenoexcept

从pair移动赋值

模板参数
T1第一个元素类型
T2第二个元素类型
参数
pir源pair
返回
当前元组的引用

在文件 tuple.hpp583 行定义.

引用了 forward() , 以及 get_rest().

◆ operator=() [4/6]

template<typename This, typename... Rest>
template<typename... U, enable_if_t< conjunction< negation< is_same< tuple, tuple< U... > > >, inner::tuple_assignable< tuple, U... > >::value, int > = 0>
NEFORCE_CONSTEXPR14 tuple & tuple< This, Rest... >::operator= ( tuple< U... > && tup)
inlinenoexcept

从其他元组移动赋值

模板参数
U源元组元素类型
参数
tup源元组
返回
当前元组的引用

在文件 tuple.hpp552 行定义.

引用了 forward(), get_rest() , 以及 tuple().

◆ operator=() [5/6]

template<typename This, typename... Rest>
template<typename T = This, enable_if_t< conjunction< is_copy_assignable< T >, is_copy_assignable< Rest >... >::value, int > = 0>
NEFORCE_CONSTEXPR14 tuple & tuple< This, Rest... >::operator= ( type_identity_t< const tuple< This, Rest... > & > tup)
inlinenoexcept

拷贝赋值运算符

模板参数
T当前元素类型
参数
tup源元组
返回
当前元组的引用

在文件 tuple.hpp503 行定义.

引用了 get_rest() , 以及 tuple().

◆ operator=() [6/6]

template<typename This, typename... Rest>
template<typename T = This, enable_if_t< conjunction< is_move_assignable< T >, is_move_assignable< Rest >... >::value, int > = 0>
NEFORCE_CONSTEXPR14 tuple & tuple< This, Rest... >::operator= ( type_identity_t< tuple< This, Rest... > && > tup)
inlinenoexcept

移动赋值运算符

模板参数
T当前元素类型
参数
tup源元组
返回
当前元组的引用

在文件 tuple.hpp518 行定义.

引用了 forward(), get_rest() , 以及 tuple().

◆ swap()

template<typename This, typename... Rest>
NEFORCE_CONSTEXPR14 void tuple< This, Rest... >::swap ( tuple< This, Rest... > & t)
inlinenoexcept

交换两个元组的内容

参数
t要交换的元组

在文件 tuple.hpp655 行定义.

引用了 swap() , 以及 tuple().

◆ to_hash()

template<typename This, typename... Rest>
NEFORCE_NODISCARD constexpr size_t tuple< This, Rest... >::to_hash ( ) const
inlineconstexprnoexcept

计算元组的哈希值

返回
元组的哈希值

在文件 tuple.hpp646 行定义.


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