1

My application requires that 100 - 200 event handler classes be instantiated (and registered) for each device that our codebase supports. My idea is to place these handlers in a list like so

typedef mpl::list<
            HandlerFoo,
            HandlerBar,
            TypedHandler<char> ,
            TypedHandler<bool>
            ...         // lots more
            > EventHandlers;

and then use boost::mpl::for_each<EventHandlers> to iterate through the list of handlers and instantiate each type. The problem is that, as I said, I may have to list up to 200. Is this a excessive use of boost::mpl::list or is there a more suitable alternative?

Olumide
  • 5,397
  • 10
  • 55
  • 104

0 Answers0