
2 May
2006
2 May
'06
5:35 p.m.
I've been working on something similar, and the best I've been able to come up with is this: <snip> If you have a limited range of var values, this should work fine. It's pretty tedious though,
That looks pretty well suited to (semi-)automated generation, either with a separate script, or with something like: #define _(x) case x: template_func<x>(); break; void func(const int& var){ switch (var){ _(1) _(2) // etc } } #undef _ This doesn't solve the limited range of values problem, though. Dale