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::to_number (1 of 3 overloads)

Return the stored number cast to an arithmetic type.

Synopsis
template<
    class T>
T
to_number(
    system::error_code& ec) const;
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

The converted number.

Parameters

Name

Description

ec

Set to the error, if any occurred.


PrevUpHomeNext