| Home | Libraries | People | FAQ | More

###### value::if_bool (2 of 2 overloads)

Return a `bool` pointer if this is a boolean, else return `nullptr`

###### Synopsis

    bool*
    if_bool();

###### Description

If `this->kind() == kind::bool_`, returns a pointer to the underlying boolean. Otherwise, returns `nullptr`.

###### Example

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

    if ( auto p = jv.if_bool() )
        return *p;

###### Complexity

Constant.

###### Exception Safety

No-throw guarantee.