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

Create a list initially containing copies of the values in the range starting at the specified `first` and ending immediately before the specified `last` iterators of the (template parameter) type `INPUT&lowbar;ITERATOR`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not supplied, a default&hyphen;constructed object of the (template parameter) type `ALLOCATOR` is used&period; If the type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma&colon;&colon;Allocator &ast;`&period; If the type `ALLOCATOR` is `bsl&colon;&colon;allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used&period; Throw `bsl&colon;&colon;length&lowbar;error` if the number of elements in `&lsqb;first &period;&period; last)&rsqb;` exceeds the size returned by `max&lowbar;size`&period; The (template parameter) type `INPUT&lowbar;ITERATOR` shall meet the requirements of an input iterator defined in the C&plus;&plus;11 standard &lsqb;input&period;iterators&rsqb;providing access to values of a type convertible to `value&lowbar;type`, and `value&lowbar;type` must be `emplace&hyphen;constructible` from `&ast;i` into this list, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;` (see &lcub;Requirements on `VALUE`&rcub;)&period; The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
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]#Created with https://www.mrdocs.com[MrDocs]#
