1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
template<typename TVal, size_t N, size_t M, typename TProcessedTypes, typename ...TRemainTypes>
struct NewTupleType_;
template<typename TVal, size_t N, template<typename...> class TCont, typename ...TModifiedTypes, typename TCurType, typename ...TRemainTypes>
struct NewTupleType_<TVal, N, N, TCont<TModifiedTypes...>, TCurType, TRemainTypes...>
{
using type = TCont<TModifiedTypes..., TVal, TRemainTypes...>;
};
template<typename TVal, size_t N, size_t M,
template<typename...> class TCont,
typename ...TModifiedTypes,
typename TCurType,
typename ...TRemainTypes>
struct NewTupleType_<TVal, N, M, TCont<TModifiedTypes...>, TCurType, TRemainTypes...>
{
using type = typename NewTupleType_<TVal, N, M + 1, TCont<TModifiedTypes..., TCurType>, TRemainTypes...>::type;
};
template<typename TVal, size_t TagPos, typename TCont, typename...TRemainTypes>
using NewTupleType = typename NewTupleType_<TVal, TagPos, 0, TCont,
TRemainTypes...>::type;
|