[sigc] Return values in libsigc++ 2.0



I am evaluating what the upgrade from 1.0/1.2 to 2.0 would look like for an existing application, and ran across one small snag. In libsigc++ 1.0/1.2 it was possible for a custom marshaller to specify the default value returned when a signal doesn't have any connections. In 2.0 the behavior is to return a default-constructed object (the accumulator object is never even created in this case). Unfortunately in my case (slots that return bool) this is undesirable. While I could work around this by testing signal.empty() before calling signal.emit(), this would mean spreading some of my signal-related logic throughout client code, and is a bit of a step backwards. Is there an explicit mechanism for handling this, or should I derive from signal and override emit() ?

Many thanks,
Tim Shead



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