[#bsl-get-056]
= xref:bsl.adoc[bsl]::get
:relfileprefix: ../
:mrdocs:

`get` overloads

== Synopses

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

Return a modifiable reference to the element of `p` having type `TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class T1,
    class T2&gt;
TYPE&
xref:bsl/get-0b0.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair&lt;T1, T2&gt;]& p) noexcept;
----

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

Return a modifiable reference to the `INDEX`th element of `p`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    std::size&lowbar;t INDEX,
    class T1,
    class T2&gt;
std::tuple&lowbar;element&lt;INDEX, bsl::pair&lt;T1, T2&gt;&gt;::type&
xref:bsl/get-00c.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair&lt;T1, T2&gt;]& p) noexcept;
----

[.small]#xref:bsl/get-00c.adoc[_» more&period;&period;&period;_]#

Return a reference to the alternative of type `t&lowbar;TYPE` in `obj`&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;
t&lowbar;TYPE&
xref:bsl/get-0ea.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]& obj);
----

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

Return a reference to the alternative at index `t&lowbar;INDEX` in `obj`&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;
variant&lowbar;alternative&lt;t&lowbar;INDEX, variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type&
xref:bsl/get-0b5.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]& obj);
----

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

Return a non&hyphen;modifiable reference to the element of `p` having type `TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class T1,
    class T2&gt;
TYPE const&
xref:bsl/get-08.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair&lt;T1, T2&gt;] const& p) noexcept;
----

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

Return a non&hyphen;modifiable reference to the `INDEX`th element of `p`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    std::size&lowbar;t INDEX,
    class T1,
    class T2&gt;
std::tuple&lowbar;element&lt;INDEX, bsl::pair&lt;T1, T2&gt;&gt;::type const&
xref:bsl/get-052.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair&lt;T1, T2&gt;] const& p) noexcept;
----

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

See the first `get` overload above&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;
t&lowbar;TYPE const&
xref:bsl/get-002.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;] const& obj);
----

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

See the first `get` overload above&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;
variant&lowbar;alternative&lt;t&lowbar;INDEX, variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type const&
xref:bsl/get-035.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;] const& obj);
----

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

Return a modifiable rvalue reference to the element of `p` of type `TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class T1,
    class T2&gt;
TYPE&&
xref:bsl/get-0e8.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair&lt;T1, T2&gt;]&& p) noexcept;
----

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

Return a modifiable rvalue reference to the `INDEX`th element of `p`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    std::size&lowbar;t INDEX,
    class T1,
    class T2&gt;
std::tuple&lowbar;element&lt;INDEX, bsl::pair&lt;T1, T2&gt;&gt;::type&&
xref:bsl/get-0b3.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair&lt;T1, T2&gt;]&& p) noexcept;
----

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

See the first `get` overload above&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;
t&lowbar;TYPE&&
xref:bsl/get-0e6.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]&& obj);
----

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

See the first `get` overload above&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;
variant&lowbar;alternative&lt;t&lowbar;INDEX, variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type&&
xref:bsl/get-0e3.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]&& obj);
----

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

Return a non&hyphen;modifiable rvalue reference to the element of `p` of `TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TYPE,
    class T1,
    class T2&gt;
TYPE const&&
xref:bsl/get-034.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair&lt;T1, T2&gt;] const&& p) noexcept;
----

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

See the first `get` overload above&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;
t&lowbar;TYPE const&&
xref:bsl/get-0ee.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;] const&& obj);
----

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

See the first `get` overload above&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;
variant&lowbar;alternative&lt;t&lowbar;INDEX, variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;&gt;::type const&&
xref:bsl/get-06.adoc[get](xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;] const&& obj);
----

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

== Return Value

* modifiable reference to the element of `p` of type `TYPE`
* modifiable reference to the `INDEX`th element of `p`
* reference to the alternative of type `t&lowbar;TYPE`
* reference to the alternative at index `t&lowbar;INDEX`
* non&hyphen;modifiable reference to the element of `p` of type `TYPE`
* non&hyphen;modifiable reference to the `INDEX`th element of `p`
* const reference to the alternative of type `t&lowbar;TYPE`
* const reference to the alternative at index `t&lowbar;INDEX`
* modifiable rvalue reference to the element of `p` of type `TYPE`
* modifiable rvalue reference to the `INDEX`th element of `p`
* rvalue reference to the alternative of type `t&lowbar;TYPE`
* rvalue reference to the alternative at index `t&lowbar;INDEX`
* non&hyphen;modifiable rvalue reference to the element of `p` of type `TYPE`
* const rvalue reference to the alternative of type `t&lowbar;TYPE`
* const rvalue reference to the alternative at index `t&lowbar;INDEX`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *p*
| pair whose element is returned
| *obj*
| variant whose alternative is accessed
|===


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