[#bsl-Pair_Second-05e-2constructor-07] = xref:bsl.adoc[bsl]::xref:bsl/Pair_Second-05e.adoc[Pair_Second]::Pair_Second :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_pair.h>` Value‐initialize the 'second' member of a 'pair'. This constructor is declared only if (template parameter) `TYPE` is default constructible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr xref:bsl/Pair_Second-05e/2constructor-00.adoc[Pair_Second]() requires std::is_default_constructible_v<TYPE>; ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-00.adoc[_» more..._]# Construct the `second` member from the specified non‐modifiable `value`, without specifying an allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr explicit xref:bsl/Pair_Second-05e/2constructor-01.adoc[Pair_Second](bsl::add_lvalue_reference<TYPE const>::type value); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-01.adoc[_» more..._]# Construct the `second` member of a `pair` from the specified `value` without specifying an allocator. This function (perfectly) forwards `value` to the constructor of (template parameter) `TYPE`. Note that this constructor is constrained to avoid accidentally becoming a stronger match for the move and copy constructors. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class PARAM, class = void> requires !bsl::is_same<Pair_Second, bsl::remove_cvref_t<PARAM>>::value constexpr explicit xref:bsl/Pair_Second-05e/2constructor-08e.adoc[Pair_Second](PARAM&& value); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-08e.adoc[_» more..._]# Construct the `second` member of a `pair`, using the specified `basicAllocator` to supply memory. This constructor is selected when (template parameter) `TYPE` takes a `bslma`‐style allocator as the second constructor argument preceded by `bsl::allocator_arg`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/Pair_Second-05e/2constructor-08f.adoc[Pair_Second]( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAllocatorArgT.adoc[Pair_BslmaIdiomAllocatorArgT]); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-08f.adoc[_» more..._]# Construct the `second` member of a `pair`, using the specified `basicAllocator` to supply memory. This constructor is selected when (template parameter) `TYPE` takes a `bslma`‐style allocator as the last constructor argument. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/Pair_Second-05e/2constructor-0f.adoc[Pair_Second]( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAtEnd.adoc[Pair_BslmaIdiomAtEnd]); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-0f.adoc[_» more..._]# Construct the `second` member of a `pair`, using the specified `basicAllocator` to supply memory. Note that exactly one of these three constructors is enabled at compile‐time for (template parameter) type `TYPE` based on the following respective criteria: 1) `TYPE` does not support `bslma`‐style allocators, 2) `TYPE` takes a `bslma`‐style allocator as the last constructor argument, and 3) `TYPE` takes a `bslma`‐style allocator as the second constructor argument preceded by `bsl::allocator_arg`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/Pair_Second-05e/2constructor-05.adoc[Pair_Second]( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomNone.adoc[Pair_BslmaIdiomNone]); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-05.adoc[_» more..._]# Construct the `second` member of a `pair`, forwarding in order the elements in the specified `argsPack` to the corresponding constructor of (template parameter) `TYPE`. The length of the `argsPack` is equal to the length of the specified (template parameter pack) `I...` and passed to the constructor via the `Pair_IndexSequence` object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class... ARGS, size_t I...> xref:bsl/Pair_Second-05e/2constructor-03.adoc[Pair_Second]( std::tuple<ARGS...>&& argsPack, xref:BloombergLP/bslstl/Pair_IndexSequence.adoc[BloombergLP::bslstl::Pair_IndexSequence<I...>]); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-03.adoc[_» more..._]# Construct the `second` member using the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PARAM> xref:bsl/Pair_Second-05e/2constructor-06b.adoc[Pair_Second]( PARAM&& value, xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAllocatorArgT.adoc[Pair_BslmaIdiomAllocatorArgT]); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-06b.adoc[_» more..._]# Construct the `second` member of a `pair` from the specified `value`, using the specified `basicAllocator` to supply memory. This constructor is selected when (template parameter) `TYPE` takes a `bslma`‐style allocator as the last constructor argument. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PARAM> xref:bsl/Pair_Second-05e/2constructor-0b.adoc[Pair_Second]( PARAM&& value, xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAtEnd.adoc[Pair_BslmaIdiomAtEnd]); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-0b.adoc[_» more..._]# Construct the `second` member of a `pair` from the specified `value`, using the specified `basicAllocator` to supply memory. This function (perfectly) forwards `value` to the constructor of (template parameter) `TYPE`. Note that exactly one of these three constructors is enabled at compile‐time for (template parameter) type `TYPE` based on the following respective criteria: 1) `TYPE` does not support `bslma`‐style allocators, 2) `TYPE` takes a `bslma`‐style allocator as the last constructor argument, and 3) `TYPE` takes a `bslma`‐style allocator as the second constructor argument preceded by `bsl::allocator_arg`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PARAM> xref:bsl/Pair_Second-05e/2constructor-06c.adoc[Pair_Second]( PARAM&& value, xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomNone.adoc[Pair_BslmaIdiomNone]); ---- [.small]#xref:bsl/Pair_Second-05e/2constructor-06c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#