[#bsl-get_if-0b]
= xref:bsl.adoc[bsl]::get&lowbar;if
:relfileprefix: ../
:mrdocs:

`get&lowbar;if` overloads

== Synopses

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

Return a pointer to the `t&lowbar;TYPE` alternative in `obj` if active&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class t&lowbar;HEAD,
    class&period;&period;&period; t&lowbar;TAIL&gt;
add&lowbar;pointer&lt;t&lowbar;TYPE&gt;::type
xref:bsl/get_if-06.adoc[get&lowbar;if](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]* obj) noexcept;
----

[.small]#xref:bsl/get_if-06.adoc[_» more&period;&period;&period;_]#

Return a pointer to the alternative at index `t&lowbar;INDEX`, or null&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    std::size&lowbar;t t&lowbar;INDEX,
    class t&lowbar;HEAD,
    class&period;&period;&period; t&lowbar;TAIL&gt;
add&lowbar;pointer&lt;variant&lowbar;alternative&lt;t&lowbar;INDEX, variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type&gt;::type
xref:bsl/get_if-0a.adoc[get&lowbar;if](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]* obj) noexcept;
----

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

Return a pointer to the `t&lowbar;TYPE` alternative in `obj` if active&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;TYPE,
    class t&lowbar;HEAD,
    class&period;&period;&period; t&lowbar;TAIL&gt;
add&lowbar;pointer&lt;t&lowbar;TYPE const&gt;::type
xref:bsl/get_if-09.adoc[get&lowbar;if](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;] const* obj) noexcept;
----

[.small]#xref:bsl/get_if-09.adoc[_» more&period;&period;&period;_]#

Return a pointer to the alternative at index `t&lowbar;INDEX` in `obj`, or null&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    std::size&lowbar;t t&lowbar;INDEX,
    class t&lowbar;HEAD,
    class&period;&period;&period; t&lowbar;TAIL&gt;
add&lowbar;pointer&lt;variant&lowbar;alternative&lt;t&lowbar;INDEX, variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type const&gt;::type
xref:bsl/get_if-0d.adoc[get&lowbar;if](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;] const* obj) noexcept;
----

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

== Return Value

* pointer to the active `t&lowbar;TYPE`, or null if inactive
* pointer to the alternative at `t&lowbar;INDEX`, or null
* const pointer to the alternative at `t&lowbar;INDEX`, or null

== Parameters

[cols="1,4"]
|===
| Name| Description
| *obj*
| variant to query
|===


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