23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.11 Class template vector [vector]

23.3.11.2 Constructors [vector.cons]

constexpr explicit vector(const Allocator&) noexcept;
Effects: Constructs an empty vector, using the specified allocator.
Complexity: Constant.
constexpr explicit vector(size_type n, const Allocator& = Allocator());
Preconditions: T is Cpp17DefaultInsertable into vector.
Effects: Constructs a vector with n default-inserted elements using the specified allocator.
Complexity: Linear in n.
constexpr vector(size_type n, const T& value, const Allocator& = Allocator());
Preconditions: T is Cpp17CopyInsertable into vector.
Effects: Constructs a vector with n copies of value, using the specified allocator.
Complexity: Linear in n.
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 N calls to the copy constructor of T (where N is the distance between first and last) and no reallocations if iterators first and last are of forward, bidirectional, or random access categories.
It makes order N calls to the copy constructor of T and order reallocations if they are just input iterators.
template<container-compatible-range<T> R> constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
Effects: Constructs a vector object with the elements of the range rg, using the specified allocator.
Complexity: Initializes exactly N elements from the results of dereferencing successive iterators of rg, where N is ranges​::​distance(rg).
Performs no reallocations if R models ranges​::​forward_range or ranges​::​sized_range; otherwise, performs order reallocations and order N calls to the copy or move constructor of T.