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

`get` overloads

== Synopses

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

Return a reference providing modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`&period; This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`&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 reference providing modifiable access to the element of the specified `p`, having the ordinal number specified by the (template parameter) `INDEX`&period; This function will not compile unless the `INDEX` is either 0 or 1&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 object with type (template parameter) `t&lowbar;TYPE` in the specified `obj`&period; If `t&lowbar;TYPE` is not the type of the currently active alternative, throw an exception of type `bad&lowbar;variant&lowbar;access`&period; `t&lowbar;TYPE` shall appear exactly once in the variant&apos;s list of alternatives&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 object at index (template parameter) `t&lowbar;INDEX` in the specified `obj`&period; If `t&lowbar;INDEX` is not the index of the currently active alternative, throw an exception of type `bad&lowbar;variant&lowbar;access`&period; `t&lowbar;INDEX` shall be a valid index for the variant type of `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 reference providing non&hyphen;modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`&period; This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`&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 reference providing non&hyphen;modifiable access to the element of the specified `p`, having the ordinal number specified by the (template parameter) `INDEX`&period; This function will not compile unless the `INDEX` is either 0 or 1&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 rvalue reference providing modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`&period; This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`&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 rvalue reference providing modifiable access to the element of the specified `p`, having the ordinal number specified by the (template parameter) `INDEX`&period; This function will not compile unless the `INDEX` is either 0 or 1&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 rvalue reference providing non&hyphen;modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`&period; This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`&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;_]#


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