mirror of
https://github.com/boostorg/leaf.git
synced 2026-01-19 04:22:08 +00:00
Significant refactoring:
- Support for error objects crossing DLL boundaries on Windows via BOOST_LEAF_CFG_WIN32=2. - Internal TLS interface improvements, separating logical allocation from reading. - Dynamic allocations (if enabled) for on_error objects now happens before stack unwinding begins. - BOOST_LEAF_SYMBOL_VISIBLE declarations now separated in config/visibility.hpp.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
# include "leaf.hpp"
|
||||
#else
|
||||
# include <boost/leaf/on_error.hpp>
|
||||
# include <boost/leaf/handle_errors.hpp>
|
||||
# include <boost/leaf/diagnostics.hpp>
|
||||
# include <boost/leaf/result.hpp>
|
||||
#endif
|
||||
@@ -69,5 +70,22 @@ int main()
|
||||
auto load = leaf::on_error( inf1, info<-42>{-42} );
|
||||
return leaf::new_error();
|
||||
});
|
||||
|
||||
#if BOOST_LEAF_CFG_CAPTURE
|
||||
(void) leaf::try_capture_all(
|
||||
[]() -> leaf::result<void>
|
||||
{
|
||||
leaf::detail::dynamic_allocator * da = leaf::detail::get_dynamic_allocator();
|
||||
BOOST_TEST(da != nullptr);
|
||||
BOOST_TEST(da->preloaded_list() == nullptr);
|
||||
{
|
||||
auto load = leaf::on_error( info<42>{42} );
|
||||
BOOST_TEST(da->preloaded_list() != nullptr);
|
||||
}
|
||||
BOOST_TEST(da->preloaded_list() == nullptr);
|
||||
return { };
|
||||
} );
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user