[#bsl-get-056] = xref:bsl.adoc[bsl]::get :relfileprefix: ../ :mrdocs: `get` overloads == Synopses Declared in `<bslstl_pair.h>` Return a reference providing modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`. This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`. [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 reference providing modifiable access to the element of the specified `p`, having the ordinal number specified by the (template parameter) `INDEX`. This function will not compile unless the `INDEX` is either 0 or 1. [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 object with type (template parameter) `t_TYPE` in the specified `obj`. If `t_TYPE` is not the type of the currently active alternative, throw an exception of type `bad_variant_access`. `t_TYPE` shall appear exactly once in the variant's list of alternatives. [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 object at index (template parameter) `t_INDEX` in the specified `obj`. If `t_INDEX` is not the index of the currently active alternative, throw an exception of type `bad_variant_access`. `t_INDEX` shall be a valid index for the variant type of `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 reference providing non‐modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`. This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`. [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 reference providing non‐modifiable access to the element of the specified `p`, having the ordinal number specified by the (template parameter) `INDEX`. This function will not compile unless the `INDEX` is either 0 or 1. [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 rvalue reference providing modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`. This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`. [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 rvalue reference providing modifiable access to the element of the specified `p`, having the ordinal number specified by the (template parameter) `INDEX`. This function will not compile unless the `INDEX` is either 0 or 1. [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 rvalue reference providing non‐modifiable access to the element of the specified `p`, having the (template parameter) `TYPE`. This function will not compile unless the types `T1` and `T2` are different and the `TYPE` is the same as either `T1` or `T2`. [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..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#