[vector.cons] (original) (raw)
22 Containers library [containers]
22.3 Sequence containers [sequences]
22.3.11 Class template vector [vector]
22.3.11.2 Constructors, copy, and assignment [vector.cons]
constexpr explicit vector(const Allocator&) noexcept;
Effects:Constructs an empty vector, using the specified allocator.
constexpr explicit vector(size_type n, const Allocator& = Allocator());
Preconditions: T is Cpp17DefaultInsertable into *this.
Effects:Constructs a vector with ndefault-inserted elements using the specified allocator.
constexpr vector(size_type n, const T& value,const Allocator& = Allocator());
Preconditions: T isCpp17CopyInsertable into *this.
Effects:Constructs a vector with ncopies of value, using the specified allocator.
template<class InputIterator> constexpr vector(InputIterator first, InputIterator last,const Allocator& = Allocator());
Effects:Constructs a vector equal to the range [first, last), using the specified allocator.
Complexity:Makes only Ncalls to the copy constructor ofT(where Nis the distance betweenfirstandlast) and no reallocations if iterators first and last are of forward, bidirectional, or random access categories.
It makes orderNcalls to the copy constructor ofTand orderlogNreallocations if they are just input iterators.