Re: [sigc] dynamic signals?



> Still, sigc::mem_fun() & Co. don't return a sigc::slot object and an
> implicit conversion to sigc::slot_base is not possible. Therefore you
> have to insert an explicit conversion.
> To answer the second question: emit() will be the only function that
> fails if there is something wrong with the types.

Ah, good point... I didn't think too much into that...
I guess the best thing to do in that case is, as you said, require an
explicit slot declaration - that way I can dynamic_cast on connection
as well (matching the sigc::slot<> types to the sigc::signal<> to cast
to).  I'll just template the connect definition and use slot<> as the
actual type instead of slot_base... it's a tad messy, but not bad...
and forces one to know the signal type....



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