
Member type value_type is the type of the elements in the container, defined in vector as an alias of its first template parameter ( T). Each of the n elements in the container will be initialized to a copy of this value. Member type size_type is an unsigned integral type. n Initial container size (i.e., the number of elements in the container at construction). If allocator_type is an instantiation of the default allocator (which has no state), this is not relevant. Member type allocator_type is the internal allocator type used by the container, defined in vector as an alias of its second template parameter ( Alloc). The container keeps and uses an internal copy of this allocator. The move constructor (5, first signature) acquires x's allocator.Īll elements are copied, moved or otherwise constructed by calling allocator_traits::construct with the appropriate arguments. The copy constructor (4, first signature) creates a container that keeps and uses a copy of the allocator returned by calling the appropriate selected_on_container_copy_construction trait on x's allocator. If no alloc argument is passed to the constructor, a default-constructed allocator is used, except in the following cases: The container keeps an internal copy of alloc, which is used to allocate and deallocate storage for its elements, and to construct and destroy them (as specified by its allocator_traits). (6) initializer list constructor Constructs a container with a copy of each of the elements in il, in the same order. X is left in an unspecified but valid state. Otherwise, no elements are constructed (their ownership is directly transferred). If alloc is specified and is different from x's allocator, the elements are moved. (5) move constructor (and moving with allocator) Constructs a container that acquires the elements of x. (4) copy constructor (and copying with allocator) Constructs a container with a copy of each of the elements in x, in the same order.


(3) range constructor Constructs a container with as many elements as the range [first,last), with each element emplace-constructed from its corresponding element in that range, in the same order. Each element is a copy of val (if provided). (2) fill constructor Constructs a container with n elements. (1) empty container constructor (default constructor) Constructs an empty container, with no elements.
