I actually use similar optimizations already...
Code:
void foo(int lOperation)
{
switch (lOperation) {
case 0:
DoSomethin1();
break;
case 1:
DoSomething2();
break;
}
}
could be written as:
Code:
lpProc[2] = { DoSomething1, DoSomething2 };
void foo(int lOperation)
{
lpProc[lOperation]();
}