强制std :: tuple包含std :: pair <fixed_type,t =“”>

时间:2016-07-24 14:37:20

标签: c++ stdtuple

是否可以使用std::tuple“部分专业化”,以便它包含std::pair<fixed_t, T>不同的T?

UPD:元组应包含对。因此,它等同于使用fixed_t数组和常规std::tuple

1 个答案:

答案 0 :(得分:4)

使用variadic tempate别名和参数包扩展:

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

Live example.

相关问题