1 #ifndef _library__exrethrow__hpp__included__
2 #define _library__exrethrow__hpp__included__
10 * Add a exception type.
12 void add_ex_spec(unsigned prio
, std::function
<bool(std::exception
& e
)> identify
,
13 std::function
<void()> (*throwfn
)(std::exception
& e
));
14 std::function
<void()> get_throw_fn(std::exception
& e
);
17 * Exception type specifier.
19 template<typename T
, unsigned prio
> class ex_spec
24 add_ex_spec(prio
, [](std::exception
& e
) -> bool { return (dynamic_cast<T
*>(&e
) != NULL
); },
25 [](std::exception
& e
) -> std::function
<void()> { T _ex
= *dynamic_cast<T
*>(&e
);
26 return [_ex
]() -> void { throw _ex
; }; });
43 * Parameter e: The exception.
45 storage(std::exception
& e
);
47 * Rethrow the exception.
57 std::function
<void()> do_rethrow
;