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

PrevUpHomeNext
value::try_to_number

Return the stored number as boost::system::result<T>.

Synopsis
template<
    class T>
boost::system::result< T >
try_to_number() const noexcept;
Description

This function attempts to return the stored value converted to the arithmetic type T which may not be bool:

Constraints
std::is_arithmetic< T >::value && ! std::is_same< T, bool >::value
Complexity

Constant.

Exception Safety

No-throw guarantee.

Return Value

boost::system::result<T> with either the converted number or an error_code.


PrevUpHomeNext