I've been using Loki for a while and I was wondering if someone faced this problem before, and if it has a simple solution. I am using a factory using also a singleton. However, at this time the creation of objects take only a single argument. I would like to be able to create objects with a variable number of parameters, because I have defined constructors for that. The type definition for the factory looks at this moment like this:
typedef Loki::SingletonHolder< Loki::Factory< NodeBase, std::string, Typelist<int, NullType> > > NodeFactory;
The number of parameters that the factory takes is given by the typelist and it seems completely constrained by it. Is there a way around this? Can I create a Factory that gives the flexibility of creating objects by passing different number of arguments?
I guess I could just create another factory, but that shouldn't be the way to solve this.
Alejandro M. Aragón
Log in to post a comment.