2
0
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:
Emil Dotchevski
2025-12-23 17:31:52 -05:00
parent d8e4a84080
commit 56b247d71a
95 changed files with 2332 additions and 903 deletions

View File

@@ -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();
}