std::experimental::ranges:: tagged
|
template
<
class
Base,
TagSpecifier
...
Tags
>
requires sizeof...
(
Tags
)
<=
std::
tuple_size
<
Base
>
::
value
|
(ranges TS) | |
类模板
tagged
对类似元组的类类型
Base
进行增强,它公开继承自该基类,并通过标签说明符
Tags...
提供一组命名访问器。标签按顺序应用:
Tags...
中的第 i 个标签说明符对应元组的第 i 个元素。
Tags...
中的标签说明符必须唯一,否则行为未定义。
无法通过指向除
Base
之外的任何基类的指针来删除
tagged
的实例。
目录 |
成员函数
构造
tagged
对象
(公开成员函数) |
|
赋值
tagged
对象
(公开成员函数) |
|
交换两个
tagged
对象的内容
(公开成员函数) |
命名元素访问器
对于
Tags...
中第
N
个标签说明符(其对应元素名称为
name
),
tagged
提供名为
name
的访问器如下:
constexpr decltype(auto) name() & { return std::get<N>(*this); } constexpr decltype(auto) name() const & { return std::get<N>(*this); } constexpr decltype(auto) name() && { return std::get<N>(std::move(*this)); }
非成员函数
为
tagged
对象特化
swap
操作
(函数) |
元组式访问
获取
tagged
对象的大小
(类模板特化) |
|
获取
tagged
对象的元素类型
(类模板特化) |
参见
|
指定类型为标签说明符
(概念) |
|
|
带标签的
std::pair
的别名模板
(别名模板) |
|
创建
tagged_pair
的便捷函数
(函数模板) |
|
|
带标签的
std::tuple
的别名模板
(别名模板) |
|
创建
tagged_tuple
的便捷函数
(函数模板) |
|
|
与
ranges::tagged
配合使用的标签说明符
(类) |