1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
template<typename strategyOne, typename strategyTwo, typename strategyThree>
void someCode(strategyOne stOne, strategyTwo stTwo, strategyThree stThree)
{
//some codes
stOne(some args);
//some codes
stTwo(some args);
//some codes
stThree(some args);
}
int main()
{
//assume that I have A number of strategies for the strategyOne
//B number for strategyTwo, C number for strategyThree
//many jobs of initialization, like
boost::functional<....> f1 = boost::bind(.....);
//fx belongs to the family of strategyOne,
//gx belongs to the family of strategyTwo
//hx belongs to the family of strategyThree
//this loop will test different combinations of all of the strategies
//I declared above
for(....)
{
//fx = f0, f1, f2, and so on
//gx = g0, g1, g2 and so on
//hx = h0, h1, h2 and so on
someCode(fx, gx, hx);
}
}
|