[#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 using the `allocator_arg` idiom. [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] idiom); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0ae.adoc[_» more..._]# Construct the `first` member with the allocator as the last 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] idiom); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0e.adoc[_» more..._]# Construct the `first` member of a `pair` with no allocator argument. [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] idiom); ---- [.small]#xref:bsl/Pair_First-00/2constructor-05.adoc[_» more..._]# Construct the `first` member from the elements of `argsPack`. [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...>] indices); ---- [.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] idiom); ---- [.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] idiom); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0a5.adoc[_» more..._]# Construct the `first` member from `value`, ignoring the allocator. [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] idiom); ---- [.small]#xref:bsl/Pair_First-00/2constructor-0c0.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *value* | value copied into the `first` member | *basicAllocator* | allocator used to supply memory | *idiom* | tag selecting the `allocator_arg` construction idiom | *argsPack* | tuple of arguments forwarded to the constructor of `TYPE` | *indices* | index sequence enumerating the elements of `argsPack` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#