Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
Prev Up HomeNext



This tutorial refers to Outcome v2.1, which is the current stable version. In early 2021 it shall be refactored to refer to Outcome v2.2. Where changes are particularly profound however, we have carved out special mention of v2.2 facilities, but otherwise if targeting v2.2, you shall need to apply the v2.1 => v2.2 upgrade guide to the content in this tutorial.

  1. Essential

    The absolute minimum that you need to know to get started with Outcome immediately.

    1. Before we begin

      Essential information before you begin the tutorial.

    2. result<>

      Gentle introduction to writing code with simple success-or-failure return types.

    3. outcome<>

      Success-or-failure return types where failure can take two forms, expected/handled failure and unexpected/abort failure.

    4. No-value policies

      Describes the concept of NoValuePolicy and how to use no-value policies.

    5. Coroutines

      Using Outcome in C++ Coroutines

    6. Conventions

      Why you should avoid custom E types in public APIs.

  2. Advanced

    If you have a bit more time, this covers all the time-saving ways you can customise and automate Outcome for various use cases, especially in larger codebases made up of multiple third party libraries.

    1. Custom payloads

      Success-or-failure return types where extra information in addition to the error code accompanies failure.

    2. Result returning constructors

      How to metaprogram construction of objects which use result to return failure instead of throwing a C++ exception.

    3. Hooking events

      Intercepting useful events such as initial construction, copies and moves so you can capture backtraces, fire debug breakpoints etc.

    4. Interoperation

      Interoperating with std::expected and other ValueOrError concept matching types.

Last revised: September 16, 2020 at 11:58:04 +0100

Prev Up HomeNext