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

3

是否可以“部分特化”使用std::tuple,以便其中包含具有不同T的std::pair<fixed_t,T>

更新:元组应该“包含这些配对”。因此,它等效于使用fixed_t数组和常规std::tuple

1个回答

4

使用可变模板别名和参数包展开:

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

Live example.


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接