Re: [sigc] Range over signals



> A dynamic_cast<> should allow this. You'd need lots of them, in an
> if/else-if block, for each sigc::signal<> type that you expect.

It turns out that the dynamic_cast fails because sigc::signal_base has
no virtual functions (not even a virtual destructor). And, of course,
at least one virtual function needs to be defined in a class to be able
to use the dynamic_cast<> cast.

The reason is probably to optimize for speed, but is it really that
important and more important than being extensible and allow for
type-safe downcasting? 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]