[#bsl-list-054-2constructor-028] = xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::list :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_list.h>` Create an empty list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/2constructor-02f.adoc[list](); ---- [.small]#xref:bsl/list-054/2constructor-02f.adoc[_» more..._]# Create a list having the same value as the specified `original`. [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..._]# Create a list of `numElements` default‐constructed elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/list-054/2constructor-06e.adoc[list](xref:bsl/list-054/size_type.adoc[size_type] numElements); ---- [.small]#xref:bsl/list-054/2constructor-06e.adoc[_» more..._]# Create a list by moving the contents of the specified `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/2constructor-065.adoc[list](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<list>] original); ---- [.small]#xref:bsl/list-054/2constructor-065.adoc[_» more..._]# Create an empty list that uses the specified `basicAllocator`. [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..._]# Create a list of `numElements` default‐constructed elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/2constructor-018.adoc[list]( xref:bsl/list-054/size_type.adoc[size_type] numElements, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/list-054/2constructor-018.adoc[_» more..._]# Create a list by moving from `original`, using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/2constructor-0a.adoc[list]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<list>] original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/list-054/2constructor-0a.adoc[_» more..._]# Create a list from the specified `values` initializer list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/2constructor-09.adoc[list]( std::initializer_list<value_type> values, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/list-054/2constructor-09.adoc[_» more..._]# Create a list with the same value as `original`, using `basicAllocator`. [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..._]# Create a list of `numElements` copies of `value`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/list-054/2constructor-043.adoc[list]( xref:bsl/list-054/size_type.adoc[size_type] numElements, xref:bsl/list-054/value_type.adoc[value_type] const& value, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/list-054/2constructor-043.adoc[_» more..._]# Create a list containing copies of the values in `[first .. last)]`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/list-054/2constructor-04f.adoc[list]( INPUT_ITERATOR first, INPUT_ITERATOR last, ALLOCATOR const& basicAllocator = ALLOCATOR()) requires !is_arithmetic<INPUT_ITERATOR>::value && !is_enum<INPUT_ITERATOR>::value; ---- [.small]#xref:bsl/list-054/2constructor-04f.adoc[_» more..._]# Create a list from the elements of the specified `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_RANGE> xref:bsl/list-054/2constructor-04a.adoc[list]( std::from_range_t tag, t_RANGE&& range, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/list-054/2constructor-04a.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *original* | list whose value is copied | *numElements* | number of default‐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]#