[#bsl-Pair_First-00-2constructor-0a7]
= xref:bsl.adoc[bsl]::xref:bsl/Pair_First-00.adoc[Pair&lowbar;First]::Pair&lowbar;First
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;bslstl&lowbar;pair&period;h&gt;`

Value&hyphen;initialize the &apos;first&apos; member of a &apos;pair&apos;&period; This constructor is declared only if (template parameter) `TYPE` is default constructible&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:bsl/Pair_First-00/2constructor-0c9.adoc[Pair&lowbar;First]()
requires std&colon;&colon;is&lowbar;default&lowbar;constructible&lowbar;v&lt;TYPE&gt;;
----

[.small]#xref:bsl/Pair_First-00/2constructor-0c9.adoc[_» more&period;&period;&period;_]#

Construct the `first` member from the specified non&hyphen;modifiable `value`, without specifying an allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
xref:bsl/Pair_First-00/2constructor-0d7.adoc[Pair&lowbar;First](bsl::add&lowbar;lvalue&lowbar;reference&lt;TYPE const&gt;::type value);
----

[.small]#xref:bsl/Pair_First-00/2constructor-0d7.adoc[_» more&period;&period;&period;_]#

Construct the `first` member from the specified `value`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class PARAM,
    class = void&gt;
requires !bsl&colon;&colon;is&lowbar;same&lt;Pair&lowbar;First, bsl&colon;&colon;remove&lowbar;cvref&lowbar;t&lt;PARAM&gt;&gt;&colon;&colon;value
constexpr
explicit
xref:bsl/Pair_First-00/2constructor-04.adoc[Pair&lowbar;First](PARAM&& value);
----

[.small]#xref:bsl/Pair_First-00/2constructor-04.adoc[_» more&period;&period;&period;_]#

Construct the `first` member of a `pair`, using the specified `basicAllocator` to supply memory&period; This constructor is selected when (template parameter) `TYPE` takes a `bslma`&hyphen;style allocator as the second constructor argument preceded by `bsl&colon;&colon;allocator&lowbar;arg`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/Pair_First-00/2constructor-0ae.adoc[Pair&lowbar;First](
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator,
    xref:bsl/Pair_BslmaIdiomAllocatorArgT.adoc[Pair&lowbar;BslmaIdiomAllocatorArgT]);
----

[.small]#xref:bsl/Pair_First-00/2constructor-0ae.adoc[_» more&period;&period;&period;_]#

Construct the `first` member of a `pair`, using the specified `basicAllocator` to supply memory&period; This constructor is selected when (template parameter) `TYPE` takes a `bslma`&hyphen;style allocator as the last constructor argument&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/Pair_First-00/2constructor-0e.adoc[Pair&lowbar;First](
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator,
    xref:bsl/Pair_BslmaIdiomAtEnd.adoc[Pair&lowbar;BslmaIdiomAtEnd]);
----

[.small]#xref:bsl/Pair_First-00/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Construct the `first` member of a `pair`, using the specified `basicAllocator` to supply memory&period; Note that exactly one of these three constructors is enabled at compile&hyphen;time for (template parameter) type `TYPE` based on the following respective criteria&colon; 1) `TYPE` does not support `bslma`&hyphen;style allocators, 2) `TYPE` takes a `bslma`&hyphen;style allocator as the last constructor argument, and 3) `TYPE` takes a `bslma`&hyphen;style allocator as the second constructor argument preceded by `bsl&colon;&colon;allocator&lowbar;arg`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/Pair_First-00/2constructor-05.adoc[Pair&lowbar;First](
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator,
    xref:bsl/Pair_BslmaIdiomNone.adoc[Pair&lowbar;BslmaIdiomNone]);
----

[.small]#xref:bsl/Pair_First-00/2constructor-05.adoc[_» more&period;&period;&period;_]#

Construct the `first` member of a `pair`, forwarding in order the elements in the specified `argsPack` to the corresponding constructor of (template parameter) `TYPE`&period; The length of the `argsPack` is equal to the length of the specified (template parameter pack) `I&period;&period;&period;` and passed to the constructor via the `Pair&lowbar;IndexSequence` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class&period;&period;&period; ARGS,
    size&lowbar;t I&period;&period;&period;&gt;
xref:bsl/Pair_First-00/2constructor-02.adoc[Pair&lowbar;First](
    std::tuple&lt;ARGS&period;&period;&period;&gt;&& argsPack,
    xref:BloombergLP/bslstl/Pair_IndexSequence.adoc[BloombergLP::bslstl::Pair&lowbar;IndexSequence&lt;I&period;&period;&period;&gt;]);
----

[.small]#xref:bsl/Pair_First-00/2constructor-02.adoc[_» more&period;&period;&period;_]#

Construct the `first` member using the specified `value` and `basicAllocator`, with `Pair&lowbar;BslmaIdiomAllocatorArgT` placement&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class PARAM&gt;
xref:bsl/Pair_First-00/2constructor-0dc.adoc[Pair&lowbar;First](
    PARAM&& value,
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator,
    xref:bsl/Pair_BslmaIdiomAllocatorArgT.adoc[Pair&lowbar;BslmaIdiomAllocatorArgT]);
----

[.small]#xref:bsl/Pair_First-00/2constructor-0dc.adoc[_» more&period;&period;&period;_]#

Construct the `first` member using the specified `value` and `basicAllocator`, with `Pair&lowbar;BslmaIdiomAtEnd` placement&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class PARAM&gt;
xref:bsl/Pair_First-00/2constructor-0a5.adoc[Pair&lowbar;First](
    PARAM&& value,
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator,
    xref:bsl/Pair_BslmaIdiomAtEnd.adoc[Pair&lowbar;BslmaIdiomAtEnd]);
----

[.small]#xref:bsl/Pair_First-00/2constructor-0a5.adoc[_» more&period;&period;&period;_]#

Construct the &apos;first&apos; member of a &apos;pair&apos; from the specified &apos;value&apos;, using the specified &apos;basicAllocator&apos; to supply memory&period; This function (perfectly) forwards &apos;value&apos; to the constructor of (template parameter) &apos;TYPE&apos; when &apos;TYPE&apos; does not use &apos;bslma&apos;&hyphen;style allocators&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class PARAM&gt;
xref:bsl/Pair_First-00/2constructor-0c0.adoc[Pair&lowbar;First](
    PARAM&& value,
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator,
    xref:bsl/Pair_BslmaIdiomNone.adoc[Pair&lowbar;BslmaIdiomNone]);
----

[.small]#xref:bsl/Pair_First-00/2constructor-0c0.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
