Okay, I'm a lot closer to my goal of having an automated factory of
objects that are dynamically polymorphic but have their inheritance set
up through static means.
What I have now is something like this:
// My factory template
template
struct Factory
{
Base *create() { return new Derived(); }
};
// My vector of factories for the different Derived types
typedef mpl::vector<
Factory,
Factory,
Factory > MyFactories;
(I actually use MPL to automatically cross and combine different
classes, which is pretty cool.)
Now I could create a vector of the same length with every type as a
pointer to a Factory function, and with Fusion I could probably
instantiate it (although I haven't got that working yet). But that still
wouldn't get me what I want, which is a table of those factory functions
that I can index into at run-time.
Can anyone suggest a technique for doing this?
Thanks,
Dan.
--
Dan Posluns, B. Eng. & Scty. (Software Engineering and Society)
dan@danposluns.com - ICQ: 35758902
http://www.danposluns.com
"The great thing about being the only species on the planet that makes
a distinction between right and wrong is that we get to make the rules
up for ourselves as we go."
- Douglas Adams, Last Chance to See