[#bsl-Pair_First-00-2constructor-0a7] = xref:bsl.adoc[bsl]::xref:bsl/Pair_First-00.adoc[Pair_First]::Pair_First :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_pair.h>` Value‐initialize the 'first' 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_First-00/2constructor-0c9.adoc[Pair_First]() requires std::is_default_constructible_v<TYPE>; ---- [.small]#xref:bsl/Pair_First-00/2constructor-0c9.adoc[_» more..._]# Construct the `first` member from the specified non‐modifiable `value`, without specifying an allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr explicit xref:bsl/Pair_First-00/2constructor-0d7.adoc[Pair_First](bsl::add_lvalue_reference<TYPE const>::type value); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0d7.adoc[_» more..._]# Construct the `first` member from the specified `value`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class PARAM, class = void> requires !bsl::is_same<Pair_First, bsl::remove_cvref_t<PARAM>>::value constexpr explicit xref:bsl/Pair_First-00/2constructor-04.adoc[Pair_First](PARAM&& value); ---- [.small]#xref:bsl/Pair_First-00/2constructor-04.adoc[_» more..._]# Construct the `first` 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_First-00/2constructor-0ae.adoc[Pair_First]( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAllocatorArgT.adoc[Pair_BslmaIdiomAllocatorArgT]); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0ae.adoc[_» more..._]# Construct the `first` 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_First-00/2constructor-0e.adoc[Pair_First]( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAtEnd.adoc[Pair_BslmaIdiomAtEnd]); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0e.adoc[_» more..._]# Construct the `first` 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_First-00/2constructor-05.adoc[Pair_First]( xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomNone.adoc[Pair_BslmaIdiomNone]); ---- [.small]#xref:bsl/Pair_First-00/2constructor-05.adoc[_» more..._]# Construct the `first` 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_First-00/2constructor-02.adoc[Pair_First]( std::tuple<ARGS...>&& argsPack, xref:BloombergLP/bslstl/Pair_IndexSequence.adoc[BloombergLP::bslstl::Pair_IndexSequence<I...>]); ---- [.small]#xref:bsl/Pair_First-00/2constructor-02.adoc[_» more..._]# Construct the `first` member using the specified `value` and `basicAllocator`, with `Pair_BslmaIdiomAllocatorArgT` placement. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PARAM> xref:bsl/Pair_First-00/2constructor-0dc.adoc[Pair_First]( PARAM&& value, xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAllocatorArgT.adoc[Pair_BslmaIdiomAllocatorArgT]); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0dc.adoc[_» more..._]# Construct the `first` member using the specified `value` and `basicAllocator`, with `Pair_BslmaIdiomAtEnd` placement. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PARAM> xref:bsl/Pair_First-00/2constructor-0a5.adoc[Pair_First]( PARAM&& value, xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomAtEnd.adoc[Pair_BslmaIdiomAtEnd]); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0a5.adoc[_» more..._]# Construct the 'first' 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' when 'TYPE' does not use 'bslma'‐style allocators. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PARAM> xref:bsl/Pair_First-00/2constructor-0c0.adoc[Pair_First]( PARAM&& value, xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator, xref:bsl/Pair_BslmaIdiomNone.adoc[Pair_BslmaIdiomNone]); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0c0.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#