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