Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
value::to_number (1 of 2 overloads)

Return the stored number cast to an arithmetic type.

Synopsis
template<
    class T>
T
to_number(
    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