I'm struggling with templates ! Consider the following code:
template <typename... Ts> struct Sequence {};
template<unsigned N> struct B {
template<unsigned P> struct C {
typedef int type;
};
};
Then this is perfectly correct:
template<unsigned... Is>
struct Loop2 {
typedef Sequence< typename B<5>::C<Is>::type... > type;
};
Loop2<3,1> l;
Therefore I can't understand why this templated version:
template<unsigned N, unsigned... Is>
struct Loop3 {
typedef Sequence< typename B<N>::C<Is>::type... > type;
};
isn't accepted by the compiler. It raise the following error:
essai.cpp:29:51: error: template argument 1 is invalid
typedef Sequence< typename B<N>::C<Is>::type... > type;
For the information I got this with
g++ (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]
Thanks for any help !
By the way: any suggestion for a better title is welcome !