Closed DirtYiCE closed 2 months ago
The documentation for try_capture_all says "catching and capturing all exceptions and all communicated error objects in the returned leaf::result object", but instead in my case it just assert fails. Simple example:
try_capture_all
#include <boost/leaf.hpp> int main() { boost::leaf::try_capture_all([]() { throw std::runtime_error("x"); }); }
Fails with:
a.out: /usr/include/boost/leaf/detail/optional.hpp:158: T &boost::leaf::leaf_detail::optional<boost::leaf::leaf_detail::dynamic_allocator>::value(int) & [T = boost::leaf::leaf_detail::dynamic_allocator]: Assertion `has_value(key) != 0' failed. Aborted
If I compile with -DNDEBUG, it simply SIGSEGVs... Tried with system boost 1.85 and the leaf.hpp downloadable from here, same results: https://raw.githubusercontent.com/boostorg/leaf/gh-pages/leaf.hpp
Confirming that this is a bug.
Fix is in feature/issue_75, I will merge in develop and master as soon as GHA CI passes.
Merged in master. Thanks for reporting.
The documentation for
try_capture_all
says "catching and capturing all exceptions and all communicated error objects in the returned leaf::result object", but instead in my case it just assert fails. Simple example:Fails with:
If I compile with -DNDEBUG, it simply SIGSEGVs... Tried with system boost 1.85 and the leaf.hpp downloadable from here, same results: https://raw.githubusercontent.com/boostorg/leaf/gh-pages/leaf.hpp