Namespaces
Variants

std:: common_type < tuple-like >

From cppreference.net
Utilities library
定义于头文件 <tuple>
template < tuple - like TTuple, tuple - like UTuple >

requires /* 见下文 */

struct common_type < TTuple, UTuple > ;
(C++23 起)

两个 tuple-like 类型的公共类型是一个 std::tuple ,由两个类型中所有对应元素类型对的公共类型组成。

给定

以下约束条件需要满足:

成员类型

成员类型 定义
type std:: tuple < std:: common_type_t < TTypes, UTypes > ... >

示例

参见

确定一组类型的公共类型
(类模板)
确定两个 pair 的公共类型
(类模板特化)