On Sun, 23 Nov 2008 18:04:18 +0100
"Olivier Tournaire"
Thank you Manfred.
[...]
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..
This is the design of the lib I use. The class I need is templated and policy based. Usually, when I know the instanciation I would like to have, I define a typedef and use it in the rest of the programm. Now, to be more generic, the programm need to let a user choose how to instanciate the class. If you have any idea about a better design, I will be very interesting in reading it.
Of the top of my head, you might want to look down Boost.variant - sure enough under the hood it may probably be a glorified switch (don't quote me on that), but your code will be all the better for it. Cheers, -- Manfred