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 an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
value::to_number (2 of 2 overloads)

Return the stored number cast to an arithmetic type.

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

Return Value

The converted number.

Exceptions

Type

Thrown On

system_error

on error.


PrevUpHomeNext