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::if_double (2 of 2 overloads)

Return a double pointer if this is a double, else return nullptr

Synopsis
double*
if_double();
Description

If this->kind() == kind::double_, returns a pointer to the underlying double. Otherwise, returns nullptr.

Example

The return value is used in both a boolean context and to assign a variable:

if( auto p = jv.if_double() )
    return *p;
Complexity

Constant.

Exception Safety

No-throw guarantee.


PrevUpHomeNext