metaprogramowanie szablonów: dlaczego typ płaski jest awarią

Chcę spłaszczyć typ drzewa do typu płaskiego. Przykład:

typedef std::tuple<int,std::tuple<int,long>,int> tup; 
Flat<tup>::type=>std::tuple<int,int,long,int>

Używam:

template<typename T>
struct Flat
{
    using type=T;
};
template <template <typename ...> class C,typename...ARGS>
struct Flat<C<ARGS...> >
{
    using type=C<ARGS...>;
};
template <template <typename ...> class C,typename ...ARGS0,typename...ARGS1,typename ...ARGS2>
struct Flat<C<ARGS0...,C<ARGS1...>,ARGS2...> >
:Flat<C<ARGS0...,ARGS1...,ARGS2...> >
{

};

void test(){
typedef std::tuple<int,std::tuple<int,long>,int> tup;
static_assert(std::is_same<typename Flat<tup>::type,std::tuple<int,int,long,int> >::value,"");
}

ale dostajęstd::tuple<int,std::tuple<int,long>,int> nadal ... Używam gcc 4.8.1

questionAnswers(2)

yourAnswerToTheQuestion