[#bsl-list-054-2constructor-028]
= xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::list
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Create an empty list&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-02f.adoc[list]();
----

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

Create a list having the same value as the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-016.adoc[list](xref:bsl/list-054.adoc[list] const& original);
----

[.small]#xref:bsl/list-054/2constructor-016.adoc[_» more&period;&period;&period;_]#

Create a list of `numElements` default&hyphen;constructed elements&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/list-054/2constructor-06e.adoc[list](xref:bsl/list-054/size_type.adoc[size&lowbar;type] numElements);
----

[.small]#xref:bsl/list-054/2constructor-06e.adoc[_» more&period;&period;&period;_]#

Create a list by moving the contents of the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-065.adoc[list](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;list&gt;] original);
----

[.small]#xref:bsl/list-054/2constructor-065.adoc[_» more&period;&period;&period;_]#

Create an empty list that uses the specified `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/list-054/2constructor-08.adoc[list](ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/list-054/2constructor-08.adoc[_» more&period;&period;&period;_]#

Create a list of `numElements` default&hyphen;constructed elements&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-018.adoc[list](
    xref:bsl/list-054/size_type.adoc[size&lowbar;type] numElements,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/list-054/2constructor-018.adoc[_» more&period;&period;&period;_]#

Create a list by moving from `original`, using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-0a.adoc[list](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;list&gt;] original,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/list-054/2constructor-0a.adoc[_» more&period;&period;&period;_]#

Create a list from the specified `values` initializer list&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-09.adoc[list](
    std::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

[.small]#xref:bsl/list-054/2constructor-09.adoc[_» more&period;&period;&period;_]#

Create a list with the same value as `original`, using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-0f.adoc[list](
    xref:bsl/list-054.adoc[list] const& original,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/list-054/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Create a list of `numElements` copies of `value`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/2constructor-043.adoc[list](
    xref:bsl/list-054/size_type.adoc[size&lowbar;type] numElements,
    xref:bsl/list-054/value_type.adoc[value&lowbar;type] const& value,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

[.small]#xref:bsl/list-054/2constructor-043.adoc[_» more&period;&period;&period;_]#

Create a list containing copies of the values in `&lsqb;first &period;&period; last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/list-054/2constructor-04f.adoc[list](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    ALLOCATOR const& basicAllocator = ALLOCATOR())
requires !is&lowbar;arithmetic&lt;INPUT&lowbar;ITERATOR&gt;&colon;&colon;value &amp;&amp;
                 !is&lowbar;enum&lt;INPUT&lowbar;ITERATOR&gt;&colon;&colon;value;
----

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

Create a list from the elements of the specified `range`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;RANGE&gt;
xref:bsl/list-054/2constructor-04a.adoc[list](
    std::from&lowbar;range&lowbar;t tag,
    t&lowbar;RANGE&& range,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| list whose value is copied
| *numElements*
| number of default&hyphen;constructed elements
| *basicAllocator*
| allocator used to supply memory
| *values*
| initializer list of values to append
| *value*
| value copied into each element
| *first*
| start of the iterator range
| *last*
| one past the end of the iterator range
| *tag*
| disambiguation tag for the range constructor
| *range*
| range of values to insert
|===


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