2
0
mirror of https://github.com/boostorg/leaf.git synced 2026-01-19 04:22:08 +00:00
Files
leaf/example
Emil Dotchevski 56b247d71a 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.
2025-12-23 17:31:52 -05:00
..
2025-12-23 17:31:52 -05:00
2025-12-23 17:31:52 -05:00
2025-12-23 17:31:52 -05:00
2025-12-23 17:31:52 -05:00
2025-06-01 03:22:57 +02:00

Example Programs Using LEAF to Handle Errors

  • print_file: This directory contains several versions of a trivial program which takes a file name on the command line and prints it. Each version uses a different error handling implementation.

  • try_capture_all_result.cpp: Shows how to transport error objects between threads in a leaf::result<T> object without using exception handling.

  • try_capture_all_exceptions.cpp: Shows how to transport error objects between threads in a leaf::result<T> object using exception handling.

  • lua_callback_result.cpp: Transporting arbitrary error objects through an uncooperative C API.

  • lua_callback_exceptions.cpp: Transporting arbitrary error objects through an uncooperative API using exceptions.

  • exception_to_result.cpp: Demonstrates how to transport exceptions through a noexcept layer in the program.

  • exception_error_log.cpp: Using accumulate to produce an error log.

  • exception_error_trace.cpp: Same as above, but the log is recorded in a std::deque rather than just printed.

  • print_half.cpp: This is a Boost Outcome example adapted to LEAF, demonstrating the use of try_handle_some to handle some errors, forwarding any other error to the caller.