For silly reasons I\'ll not go into here, I need the commented out line to work and the line above it it to not work:
template
I've been playing with it all night and finally got something to work (changed my casing to match the STL):
template
struct reverse_tuple_outer
{
template
struct reverse_tuple_inner: reverse_tuple_outer<_N-1, _Head, _All...>::template reverse_tuple_inner<_Tail...> { };
};
template
struct reverse_tuple_outer<0, _All...>
{
template
struct reverse_tuple_inner {
typedef std::tuple<_All...> type;
};
};
template
struct reverse_tuple
{
typedef typename reverse_tuple_outer::template reverse_tuple_inner<_Args...>::type type;
};
template
struct strip_and_reverse_tuple;
template
struct strip_and_reverse_tuple>
{
typedef typename reverse_tuple<_Args...>::type type;
};
template
struct partial_tuple
{
typedef typename strip_and_reverse_tuple::template reverse_tuple_inner<_Args...>::type>::type type;
};
int main()
{
//partial_tuple<1, std::string, std::string, int, int>::type A{"test", 5, 1};
partial_tuple<1, std::string, std::string, int, int>::type B{"test", "test", 5};
}
As an added bonus, I also have reverse_tuple, should I ever need it.