visit overloads
Declared in <bdljsn_json.h>
Return the result (having a deduced type) of invoking the specified visitor (callable) object on this Json object. visitor must be callable as if it provides the following overloads of operator(), any of which can have deduced return types: ` decltype(auto) operator()(JsonObject *object ); decltype(auto) operator()(JsonArray *array ); decltype(auto) operator()(bsl::string *string ); decltype(auto) operator()(JsonNumber *number ); decltype(auto) operator()(bool *boolean); decltype(auto) operator()(JsonNull *null ); ` The overload corresponding to the current type() of this Json object is invoked. The behavior is undefined unless all of these six overloads are defined and each has the same return type. The behavior is undefined if the string overload leaves this Json object with a string that is not valid UTF-8. Note that overloads that are not applicable in a given application need not do anything other than return. Also note that if visitor is const qualified then each of its operator() overloads must also be const qualified.
template<class VISITOR>
decltype(auto)
visit(VISITOR&& visitor);
» more...
Return the result (having a deduced type) of invoking the specified visitor (callable) object on this Json object. visitor must be callable as if it provides the following overloads of operator(), any of which can have deduced return types: ` decltype(auto) operator()(const JsonObject& object ); decltype(auto) operator()(const JsonArray& array ); decltype(auto) operator()(const bsl::string& string ); decltype(auto) operator()(const JsonNumber& number ); decltype(auto) operator()(const bool& boolean); decltype(auto) operator()(const JsonNull& null ); ` The overload corresponding to the current type() of this Json object is invoked. The behavior is undefined unless all of these six overloads are defined and each has the same return type. Note that overloads that are not applicable in a given application need not do anything other than return. Also note that if visitor is const qualified then each of its operator() overloads must also be const qualified.
template<class VISITOR>
decltype(auto)
visit(VISITOR&& visitor) const;
» more...
Return the result (having RETURN_TYPE) of invoking the specified visitor (callable) object on this Json object. visitor must be callable as if it provides the following overloads of operator(): ` RETURN_TYPE operator()(JsonObject *object ); RETURN_TYPE operator()(JsonArray *array ); RETURN_TYPE operator()(bsl::string *string ); RETURN_TYPE operator()(JsonNumber *number ); RETURN_TYPE operator()(bool *boolean); RETURN_TYPE operator()(JsonNull *null ); ` The overload corresponding to the current type() of this Json object is invoked. For C++03 visitor must be const qualified. The behavior is undefined unless all of these six overloads are defined. The behavior is undefined if the string overload leaves this Json object with a string that is not valid UTF-8. Note that overloads that are not applicable in a given application need not do anything other than return. Also note that if visitor is const qualified then each of its operator() overloads must also be const qualified.
template<
class RETURN_TYPE,
class VISITOR>
RETURN_TYPE
visit(VISITOR&& visitor);
» more...
Return the result (having RETURN_TYPE) of invoking the specified visitor (callable) object on this Json object. visitor must be callable as if it provides the following overloads of operator(): ` RETURN_TYPE operator()(const JsonObject& object ); RETURN_TYPE operator()(const JsonArray& array ); RETURN_TYPE operator()(const bsl::string& string ); RETURN_TYPE operator()(const JsonNumber& number ); RETURN_TYPE operator()(const bool& boolean); RETURN_TYPE operator()(const JsonNull& null ); ` The overload corresponding to the current type() of this Json object is invoked. For C++03 visitor must be const-qualified. The behavior is undefined unless all of these six overloads are defined. Note that overloads that are not applicable in a given application need not do anything other than return. Also note that if visitor is const qualified then each of its operator() overloads must also be const qualified.
template<
class RETURN_TYPE,
class VISITOR>
RETURN_TYPE
visit(VISITOR&& visitor) const;
» more...