void func(int cnt)
{
for (int i = 0; i < cnt; ++i) {
#ifdef BAR
ClassB foo;
#else
ClassA foo;
#endif
foo.put();
//だとかなんだか、諸々の処理
}
}
概ねこげな関数がある。
今はマクロでClassA/ClassBを使い分けてるが、
これをbool barを引き数として渡して動的に使い分けるようにしたい。
なんかいい手はないもんだろか。