...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Return an object
pointer if this is an
object, else return nullptr
object
*
if_object() noexcept;
If this->kind() == kind::object
,
returns a pointer to the underlying object. Otherwise, returns nullptr
.
The return value is used in both a boolean context and to assign a variable:
if( auto p = jv.if_object() ) return *p;
Constant.
No-throw guarantee.