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

Method if_bool

include/boost/json/value.hpp:1631–1637  ·  view source on GitHub ↗

Return a pointer to the underlying `bool` . If `this->kind() == kind::bool_`, returns a pointer to the underlying boolean. 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_bool() ) return *p; @endcode @par Complexity

Source from the content-addressed store, hash-verified

1629 @{
1630 */
1631 bool const*
1632 if_bool() const noexcept
1633 {
1634 if(kind() == json::kind::bool_)
1635 return &sca_.b;
1636 return nullptr;
1637 }
1638
1639 bool*
1640 if_bool() noexcept

Callers 3

testIfMethod · 0.80
check_refMethod · 0.80
value_to_implFunction · 0.80

Calls 1

kindEnum · 0.85

Tested by

no test coverage detected