From 4f8e4d032ad957ca855e722d38ccfd7188835653 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Wed, 9 Jan 2019 23:05:18 -0800 Subject: [PATCH] warnings, compile errors --- include/boost/leaf/result.hpp | 1 + include/boost/leaf/try.hpp | 4 ++++ 2 files changed, 5 insertions(+) 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