强制 std::tuple 包含 std::p air<fixed_type, T>

Forcing std::tuple to contain std::pair<fixed_type, T>

本文关键字:std type gt fixed tuple air 强制 lt 包含      更新时间:2023-10-16

是否可以使用"部分专用"的std::tuple,使其包含具有不同T的std::pair<fixed_t, T>

UPD:元组应该包含对。因此,它相当于将一个fixed_t的数组与一个正则std::tuple一起使用。

使用可变临时别名和参数包扩展:

template<typename... Types>
using fixed_tuple = std::tuple< std::pair<fixed_t, Types>... >;

活生生的例子。

相关文章: