Atm i have sth like that:
template<int n>
struct Pow
{
enum{val= Pow<n-1>::val<<1};
};
template<>
struct Pow<0>{
enum{val =1};
};
I can acess data like Pow<30>::val. It’s good but i want do like this
int main()
{
Pow<30>::val;
and then use variable to
access all of value <0,30>
I knew that i can use array and dynamic programming but can i do that in this way?
Sorry for English.
Using C++0x variadic templates:
and then:
So that’s with using an array but without dynamic initialization. Since you want the result as a variable and not for TMP I feel this is adequate.