Template:cpp/container/constructor

Constructs a new container from a variety of data sources, optionally using a user supplied allocator.

@1@ Default constructor. Constructs an empty container with a default-constructed allocator.

@2@ Constructs an empty container with the given allocator.

@3@ Constructs the container with copies of elements with value.

@4@ Constructs the container with default-inserted instances of. No copies are made.

@5@ Constructs the container with the contents of the range.

@6@ Copy constructor. Constructs the container with the copy of the contents of.

@7@ Constructs the container with the copy of the contents of, using as the allocator.

@8@ Move constructor. Constructs the container with the contents of using move semantics. Allocator is obtained by move-construction from the allocator belonging to.

@9@ Allocator-extended move constructor. Using as the allocator for the new container, moving the contents from ; if, this results in an element-wise move.

@10@ Constructs the container with the contents of the initializer list.

Complexity
@1-2@ Constant

@3-4@ Linear in

@6-7@ Linear in size of

@8@ Constant.

@9@ Linear if, otherwise constant.

@10@ Linear in size of.

Exceptions
Calls to may throw.