That was one way I attempted to do it. Problem? My compiler choked! The message was:
"Internal compiler error."
"Please submit a full bug report."
Ha! You know you're really desperate when you've pushed the compiler that far!
Anyway, I solved the problem by implementing an ingenious but simple functor algorithm.
Hey if you like templates you should check out this site. It shows you how to use the compilation process as a meta-program using templates! This one guy wrote a class that when compiled, returned several errors, which, when viewed together, gave you a table of prime numbers! Quite interesting!
Damn! Can't find the bookmark. I'll get back to you with that URL, if you're interested.