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 a snapshot of the develop branch, built from commit 816d67cab6.
Prev Up HomeNext

value_type &assume_value() & noexcept

Narrow contract lvalue reference observer of any value present. NoValuePolicy::narrow_value_check() is first invoked, then the reference to the value is returned. The convention is that hard undefined behaviour occurs if no value is actually present, however NoValuePolicy::narrow_value_check() can do something to avoid that.

Note that if value_type is void, only a const overload returning void is present.

Requires: Always available.

Complexity: Depends on NoValuePolicy::narrow_value_check().

Guarantees: An exception is never thrown.

Last revised: February 12, 2019 at 16:36:24 UTC


Prev Up HomeNext