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