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

Method if_string

include/boost/json/value.hpp:1479–1485  ·  view source on GitHub ↗

Return a pointer to the underlying @ref string. If `this->kind() == kind::string`, 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_string() ) return *p; @endcode @par Compl

Source from the content-addressed store, hash-verified

1477 @{
1478 */
1479 string const*
1480 if_string() const noexcept
1481 {
1482 if(kind() == json::kind::string)
1483 return &str_;
1484 return nullptr;
1485 }
1486
1487 string*
1488 if_string() noexcept

Callers 6

tag_invokeFunction · 0.80
testIfMethod · 0.80
usingValuesFunction · 0.80
tag_invokeFunction · 0.80
check_refMethod · 0.80
value_to_implFunction · 0.80

Calls 1

kindEnum · 0.85

Tested by

no test coverage detected