...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Return result
with the
underlying std::uint64_t
boost::system::result
<std::uint64_t
> try_as_uint64() const noexcept;
If is_uint64()
is true
, the result contains
a copy of the underlying std::uint64_t
,
otherwise it contains an error_code
.
The return value can be used in both a boolean context and to assign a variable:
if( auto r = jv.try_as_uint64() ) return *r;
But can also be used to throw an exception on error:
return jv.try_as_uint64().value();
Constant.
No-throw guarantee.