MCPcopy Create free account
hub / github.com/boostorg/json / if_object

Method if_object

include/boost/json/value.hpp:1441–1447  ·  view source on GitHub ↗

Return a pointer to the underlying @ref object. If `this->kind() == kind::object`, returns a pointer to the underlying object. Otherwise, returns `nullptr`. @par Example The return value is used in both a boolean context and to assign a variable: @code if( auto p = jv.if_object() ) return *p; @endcode @par Compl

Source from the content-addressed store, hash-verified

1439 @{
1440 */
1441 object const*
1442 if_object() const noexcept
1443 {
1444 if(kind() == json::kind::object)
1445 return &obj_;
1446 return nullptr;
1447 }
1448
1449 object*
1450 if_object() noexcept

Callers 5

testIfMethod · 0.80
usingValuesFunction · 0.80
usingPointerFunction · 0.80
check_refMethod · 0.80
value_to_implFunction · 0.80

Calls 1

kindEnum · 0.85

Tested by

no test coverage detected