![]() |
![]() |
Note that the catcher is expected to return the same type as the wrapped functor so that normal flow can continue.
Catchers can be cascaded to catch multiple types because uncaught rethrown exceptions proceed to the next catcher adaptor.
struct my_catch { int operator()() { try { throw; } catch (std::range_error e) // catch what types we know { std::cerr << "caught " << e.what() << std::endl; } return 1; } } int foo(); // throws std::range_error sigc::exception_catch(&foo, my_catch())();
sigc::signal<int> some_signal; some_signal.connect(sigc::exception_catch(&foo, my_catch));