[#bsl-get-056] = xref:bsl.adoc[bsl]::get :relfileprefix: ../ :mrdocs: `get` overloads == Synopses Declared in `<bslstl_pair.h>` Return a modifiable reference to the element of `p` having type `TYPE`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TYPE, class T1, class T2> TYPE& xref:bsl/get-0b0.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair<T1, T2>]& p) noexcept; ---- [.small]#xref:bsl/get-0b0.adoc[_» more..._]# Return a modifiable reference to the `INDEX`th element of `p`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t INDEX, class T1, class T2> std::tuple_element<INDEX, bsl::pair<T1, T2>>::type& xref:bsl/get-00c.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair<T1, T2>]& p) noexcept; ---- [.small]#xref:bsl/get-00c.adoc[_» more..._]# Return a reference to the alternative of type `t_TYPE` in `obj`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_HEAD, class... t_TAIL> t_TYPE& xref:bsl/get-0ea.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]& obj); ---- [.small]#xref:bsl/get-0ea.adoc[_» more..._]# Return a reference to the alternative at index `t_INDEX` in `obj`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD, class... t_TAIL> variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type& xref:bsl/get-0b5.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]& obj); ---- [.small]#xref:bsl/get-0b5.adoc[_» more..._]# Return a non‐modifiable reference to the element of `p` having type `TYPE`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TYPE, class T1, class T2> TYPE const& xref:bsl/get-08.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair<T1, T2>] const& p) noexcept; ---- [.small]#xref:bsl/get-08.adoc[_» more..._]# Return a non‐modifiable reference to the `INDEX`th element of `p`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t INDEX, class T1, class T2> std::tuple_element<INDEX, bsl::pair<T1, T2>>::type const& xref:bsl/get-052.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair<T1, T2>] const& p) noexcept; ---- [.small]#xref:bsl/get-052.adoc[_» more..._]# See the first `get` overload above. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_HEAD, class... t_TAIL> t_TYPE const& xref:bsl/get-002.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>] const& obj); ---- [.small]#xref:bsl/get-002.adoc[_» more..._]# See the first `get` overload above. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD, class... t_TAIL> variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type const& xref:bsl/get-035.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>] const& obj); ---- [.small]#xref:bsl/get-035.adoc[_» more..._]# Return a modifiable rvalue reference to the element of `p` of type `TYPE`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TYPE, class T1, class T2> TYPE&& xref:bsl/get-0e8.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair<T1, T2>]&& p) noexcept; ---- [.small]#xref:bsl/get-0e8.adoc[_» more..._]# Return a modifiable rvalue reference to the `INDEX`th element of `p`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t INDEX, class T1, class T2> std::tuple_element<INDEX, bsl::pair<T1, T2>>::type&& xref:bsl/get-0b3.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair<T1, T2>]&& p) noexcept; ---- [.small]#xref:bsl/get-0b3.adoc[_» more..._]# See the first `get` overload above. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_HEAD, class... t_TAIL> t_TYPE&& xref:bsl/get-0e6.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]&& obj); ---- [.small]#xref:bsl/get-0e6.adoc[_» more..._]# See the first `get` overload above. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD, class... t_TAIL> variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type&& xref:bsl/get-0e3.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]&& obj); ---- [.small]#xref:bsl/get-0e3.adoc[_» more..._]# Return a non‐modifiable rvalue reference to the element of `p` of `TYPE`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TYPE, class T1, class T2> TYPE const&& xref:bsl/get-034.adoc[get](xref:bsl/pair-0b.adoc[bsl::pair<T1, T2>] const&& p) noexcept; ---- [.small]#xref:bsl/get-034.adoc[_» more..._]# See the first `get` overload above. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_HEAD, class... t_TAIL> t_TYPE const&& xref:bsl/get-0ee.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>] const&& obj); ---- [.small]#xref:bsl/get-0ee.adoc[_» more..._]# See the first `get` overload above. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD, class... t_TAIL> variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>::type const&& xref:bsl/get-06.adoc[get](xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>] const&& obj); ---- [.small]#xref:bsl/get-06.adoc[_» more..._]# == 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_TYPE` * reference to the alternative at index `t_INDEX` * non‐modifiable reference to the element of `p` of type `TYPE` * non‐modifiable reference to the `INDEX`th element of `p` * const reference to the alternative of type `t_TYPE` * const reference to the alternative at index `t_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_TYPE` * rvalue reference to the alternative at index `t_INDEX` * non‐modifiable rvalue reference to the element of `p` of type `TYPE` * const rvalue reference to the alternative of type `t_TYPE` * const rvalue reference to the alternative at index `t_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]#