diff --git a/include/boost/leaf/result.hpp b/include/boost/leaf/result.hpp index 2c1fc3f..af2210b 100644 --- a/include/boost/leaf/result.hpp +++ b/include/boost/leaf/result.hpp @@ -9,6 +9,7 @@ #include #include +#include #define LEAF_AUTO(v,r) auto _r_##v = r; if( !_r_##v ) return _r_##v.error(); auto & v = *_r_##v #define LEAF_CHECK(r) {auto _r = r; if( !_r ) return _r.error();} diff --git a/include/boost/leaf/try.hpp b/include/boost/leaf/try.hpp index b20e5ba..0eb1db9 100644 --- a/include/boost/leaf/try.hpp +++ b/include/boost/leaf/try.hpp @@ -47,6 +47,10 @@ namespace boost { namespace leaf { { return ss.handle_error(get_error(ex), &ex, std::forward(handlers)..., [ ]() -> typename leaf_detail::function_traits::return_type { throw; }); } + catch( ... ) + { + return ss.handle_error(next_error_value(), 0, std::forward(handlers)..., [ ]() -> typename leaf_detail::function_traits::return_type { throw; }); + } } namespace leaf_detail