Am 21.02.2012 17:45, schrieb Florian Philipp: > Hi list! > > Sorry if this is a dumb question but I cannot really figure this out: > Can I use the exception_catch adaptor with slots that pass parameters? > If the answer is yes, what is wrong with this code: > > class SlotExceptionHandler { > void operator()(); > } > SlotExceptionHandler* exception_handler; > slot<bool, Glib::IOCondition> real_slot; > > slot<void> except_functor = mem_fun(*exception_handler, > &SlotExceptionHandler::operator()); > slot<void, IOCondition> param_except = hide(except_functor); > slot<bool, IOCondition> return_except = bind_return(param_except, true); > slot<bool, IOCondition> combined_slot = exception_catch(real_slot, > return_except); > > gcc aborts on the last line: > /usr/include/sigc++-2.0/sigc++/adaptors/exception_catch.h:82: error: no > match for call to ‘(sigc::slot<bool, Glib::IOCondition, sigc::nil, > sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>) ()’ > /usr/include/sigc++-2.0/sigc++/functors/slot.h:512: note: candidates > are: T_return sigc::slot1<T_return, T_arg1>::operator()(typename > sigc::type_trait<T_derived>::take) const [with T_return = bool, T_arg1 = > Glib::IOCondition] > > If it's relevant: This is a SuSE Enterprise distribution, GTK+ is around > 2.18, Gnome 2.28. I cannot check the sigc version right now. > > Thanks in advance! > Florian Philipp > > Nevermind. I didn't realize the exception handling slot doesn't need to have the same parameters as the real slot, just the same return value. Regards, Florian Philipp
Attachment:
signature.asc
Description: OpenPGP digital signature