| Home | Libraries | People | FAQ | More

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

Return an `object` pointer if this is an object, else return `nullptr`

<h7> Synopsis </h7>

    object*
    if_object();

<h7> Description </h7>

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

<h7> Example </h7>

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

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

<h7> Complexity </h7>

Constant.

<h7> Exception Safety </h7>

No-throw guarantee.