Boost C++ Libraries

...one 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

success_type<T>

Type sugar for constructing a successful result or outcome. Generally not constructed directly, but via the free function success(T &&) . Detectable using is_success_type<T> .

This is a regular wrapper type, with defaulted default, copy and move constructor, defaulted assignment, and defaulted destructor.

A member type alias value_type indicates T.

There is an explicit initialising constructor taking any type U which is not a success_type<T>, and which will forward construct the contained T from that U.

There is a .value() reference observer with the usual constexpr lvalue, const lvalue, rvalue and const rvalue overloads.

There is a specialisation success_type<void> which stores nothing and provides no .value() observers.

Requires: Nothing.

Namespace: BOOST_OUTCOME_V2_NAMESPACE

Header: <boost/outcome/success_failure.hpp>

Last revised: January 21, 2019 at 18:00:41 UTC


Prev Up HomeNext