Thomas Immich
Hello,
I have the following problem:
I want to add signals to an emitting class in a generic fashion. To add a signal data member for every signal type, I inherit privately from a list of signal types. I therefore use the mpl::inherit template.
class Emitter: private boost::mpl::inherit< boost::signal
, // emitted when size changes boost::signal // emitted when name changes > { public: };
Since I want some signals to be connected automatically, I need to iterate the list of signal types. Is it possible to get a mpl::list with all the types I used within mpl::inherit?
The way to do this is to start with the type sequence, and generate the inheritance from that: typedef mpl::vector< void(Emitter const&, int,int), void(Emitter const&, char const*)
signals;
class Emitter : private mpl::fold< signals , mpl::inherit<_1,_2> , mpl::empty_base > {...}; HTH, Dave -- Dave Abrahams Boost Consulting http://www.boost-consulting.com