[#bsl-vector-00d-2constructor-037] = xref:bsl.adoc[bsl]::xref:bsl/vector-00d.adoc[vector]::vector :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_vector.h>` Create an empty vector. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/2constructor-0c87.adoc[vector]() noexcept; ---- [.small]#xref:bsl/vector-00d/2constructor-0c87.adoc[_» more..._]# Copy‐construct a vector from `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/2constructor-01b.adoc[vector](xref:bsl/vector-00d.adoc[vector] const& original); ---- [.small]#xref:bsl/vector-00d/2constructor-01b.adoc[_» more..._]# Create a vector by moving from the specified `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/2constructor-05d.adoc[vector](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<vector>] original) noexcept; ---- [.small]#xref:bsl/vector-00d/2constructor-05d.adoc[_» more..._]# Create an empty vector that uses the specified `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/vector-00d/2constructor-0c8a.adoc[vector](ALLOCATOR const& basicAllocator) noexcept; ---- [.small]#xref:bsl/vector-00d/2constructor-0c8a.adoc[_» more..._]# Create a vector of the specified `initialSize` default‐constructed elements. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/vector-00d/2constructor-07.adoc[vector]( xref:bsl/vector-00d/size_type.adoc[size_type] initialSize, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/vector-00d/2constructor-07.adoc[_» more..._]# Create a vector having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/2constructor-0e5.adoc[vector]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<vector>] original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/vector-00d/2constructor-0e5.adoc[_» more..._]# Create a vector and insert (in order) each `VALUE_TYPE` object in the specified `values` initializer list. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/2constructor-031.adoc[vector]( std::initializer_list<VALUE_TYPE> values, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/vector-00d/2constructor-031.adoc[_» more..._]# Create a vector having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/2constructor-01a.adoc[vector]( xref:bsl/vector-00d.adoc[vector] const& original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/vector-00d/2constructor-01a.adoc[_» more..._]# Create a vector of `initialSize` elements each equal to `value`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/2constructor-0e1.adoc[vector]( xref:bsl/vector-00d/size_type.adoc[size_type] initialSize, VALUE_TYPE const& value, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/vector-00d/2constructor-0e1.adoc[_» more..._]# Create a vector from the specified iterator range. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> xref:bsl/vector-00d/2constructor-051.adoc[vector]( INPUT_ITER first, INPUT_ITER last, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/vector-00d/2constructor-051.adoc[_» more..._]# Create a vector from the elements of the specifed `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_RANGE> xref:bsl/vector-00d/2constructor-0d.adoc[vector]( std::from_range_t unused, t_RANGE&& range, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/vector-00d/2constructor-0d.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *original* | vector whose value to copy | *basicAllocator* | allocator used to supply memory | *initialSize* | number of elements to create | *values* | initializer list of elements | *value* | value copied into each element | *first* | the start of the iterator range | *last* | one past the end of the iterator range | *unused* | tag selecting the from‐range constructor overload | *range* | input range of elements |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#