Error-handling C++11
Added in 1.75.0

Boost.Leaf

A lightweight error handling library for C++11.

About Boost.Leaf

Please check out the library's documentation to learn more.

In Progress Branch

You are viewing the develop version of this library.

The master and develop pages are shown here to provide access to the newest in-development in-progress documentation. See the "Documentation" link on this page.

Other aspects of the page will reflect the previous official version, or not be available until the next release.

Contributors: This Release


Documentation

LEAF

A lightweight error handling library for C++11.

Documentation

https://boostorg.github.io/leaf/

Features

  • Portable single-header format, no dependencies.
  • Tiny code size, configurable for embedded development.
  • No dynamic memory allocations, even with very large payloads.
  • Deterministic unbiased efficiency on the "happy" path and the "sad" path.
  • Error objects are handled in constant time, independent of call stack depth.
  • Can be used with or without exception handling.

Support

Distribution

Besides GitHub, there are two other distribution channels:

  • LEAF is included in official Boost releases, starting with Boost 1.75.
  • For maximum portability, the library is also available in single-header format: leaf.hpp.

Copyright 2018-2025 Emil Dotchevski and Reverge Studios, Inc. Distributed under the http://www.boost.org/LICENSE_1_0.txt[Boost Software License, Version 1.0].

Join the Boost Developers Mailing List

Get the latest on releases, features, security patches, fixes and all major announcements.

All Contributors