Let's say I have a type that is parameterized by another integral POD type:
template< size_t N > struct MyFoo { };
With it you can get a tuple of them:
typedef std::tuple< MyFoo< 1 >, MyFoo< 2 >, MyFoo< 3 > > Foo3;
But now I want to have type " Foo< N > ", where N is constexpr . One way to achieve something similar to Foo< N > would be to:
template< size_t N > struct Foos; template<> struct Foos< 1 >{ typedef std::tuple< MyFoo< 1 > > type; }; template<> struct Foos< 2 >{ typedef std::tuple< MyFoo< 1 >, MyFoo< 2 > > type; };
th. specialize it manually for every N I want. Is there a more general way to do this?
Thanks:)
Sh4pe source share