Hello Oliver,
See inline below..
On Sun, 23 Nov 2008 15:31:12 +0100
"Olivier Tournaire"
switch(priorType) { case 0: switch(dataType) { case 0: { MyModel
aModel; aModel.SetInput(...); aModel.Optimize(...); } break; case 1: { MyModel aModel; aModel.SetInput(...); aModel.Optimize(...); } break; default: break; } case 1: switch(dataType) { case 0: { MyModel aModel; aModel.SetInput(...); aModel.Optimize(...); } break; case 1: { MyModel aModel; aModel.SetInput(...); aModel.Optimize(...); } break; default: break; } default: break; } I would like to know if there is a way to automate the above switch generation. As I have 5 templates, and not only 2, this will really helps ... I tried using BOOST_PP_SEQ_FOR_EACH but did not came to a result. Then, there is a lot of duplication in the above code. Am I doing the right way ?
Looks like an awful lot of repetition, and would have to take a closer
look at your problem for advice on design. However, to get you going,
below is the Boost.PP work to do what you want - but think even that
could be done better..
#include