[#BloombergLP-bdljsn-Json-visit-02] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/Json.adoc[Json]::visit :relfileprefix: ../../../ :mrdocs: 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. == Synopsis Declared in `<bdljsn_json.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RETURN_TYPE, class VISITOR> RETURN_TYPE visit(VISITOR&& visitor); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#