[#bsl-visit-0de]
= xref:bsl.adoc[bsl]::visit
:relfileprefix: ../
:mrdocs:

`visit` overloads

== Synopses

Declared in `&lt;bslstl&lowbar;variant&period;h&gt;`

Return the result of invoking `visitor` with the active alternative of `variant`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;VISITOR,
    class t&lowbar;VARIANT&gt;
bsl::invoke&lowbar;result&lt;t&lowbar;VISITOR&&, decltype(get&lt;0&gt;(BloombergLP&colon;&colon;bslstl&colon;&colon;Variant&lowbar;ImpUtil&colon;&colon;
                    asVariant(std&colon;&colon;forward&lt;t&lowbar;VARIANT&gt;(variant))))&gt;::type
xref:bsl/visit-0d1.adoc[visit](
    t&lowbar;VISITOR&& visitor,
    t&lowbar;VARIANT&& variant);
----

[.small]#xref:bsl/visit-0d1.adoc[_» more&period;&period;&period;_]#

Return the result of invoking `visitor` with the active alternative of `variant`, converted to `t&lowbar;RET`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;RET,
    class t&lowbar;VISITOR,
    class t&lowbar;VARIANT&gt;
t&lowbar;RET
xref:bsl/visit-0f.adoc[visit](
    t&lowbar;VISITOR&& visitor,
    t&lowbar;VARIANT&& variant);
----

[.small]#xref:bsl/visit-0f.adoc[_» more&period;&period;&period;_]#

== Return Value

* result of invoking `visitor` on the active alternative
* result of invoking `visitor`, converted to `t&lowbar;RET`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *visitor*
| callable to invoke on the active alternative
| *variant*
| variant whose active alternative is visited
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
