I'm trying to create a template class based on user input. For example: template< int i, int j, int k > class T {}; int main() { int i, j, k; cin >> i >> j >> k; T t; } Naturally, this is not possible, as i, j, and k must be constants. Therefore, I would like to limit the maximum value of i, j, and k to 100 and create all permutations for T at compile time. Basically, something like this: int main() { int i, j, k; cin >> i >> j >> k; if( i == 0 && j == 0 && k == 0 ) { T<0,0,0> t; } else if( i == 0 && j == 0 && k == 1 ) { T<0,0,1> t; } ... else if( i == 100 && j == 100 && k == 100 ) { T<100,100,100> t; } } Naturally, I don't want to type all that in myself, so I was hoping the boost preprocessor library could do it for me. If someone knows of a way to do it, please let me know. Thanks! Tanton [Non-text portions of this message have been removed]