28 lines
736 B
C++
28 lines
736 B
C++
#ifndef PFOR_PFOR_MP_TUPLE_H
|
|
#define PFOR_PFOR_MP_TUPLE_H
|
|
|
|
#include "pack.h"
|
|
|
|
namespace pfor {
|
|
|
|
template<typename, typename> struct SubTupleImpl;
|
|
|
|
/* // more generic version
|
|
template<template<typename...> class Tuple, typename... Ts, template<typename...> class Indices, template<std::size_t> class Index, std::size_t... indices>
|
|
struct SubTupleImpl<Tuple<Ts...>, Indices<Index<indices>...>> {
|
|
using type = Tuple<PackGet<Pack<Ts...>, indices>...>;
|
|
};
|
|
*/
|
|
|
|
template<typename... Ts, std::size_t... indices>
|
|
struct SubTupleImpl<std::tuple<Ts...>, Pack<UIntToType<indices>...>> {
|
|
using type = std::tuple<PackGet<Pack<Ts...>, indices>...>;
|
|
};
|
|
|
|
template<typename T, typename I>
|
|
using SubTuple = typename SubTupleImpl<T, I>::type;
|
|
|
|
}
|
|
|
|
#endif
|