|
|
(2) fill constructor Constructs a container with n elements. Each element is a copy of val (if provided). (4) copy constructor (and copying with allocator) Constructs a container with a copy of each of the elements in x, in the same order. (5) move constructor (and moving with allocator) Constructs a container that acquires the elements of x. If alloc is specified and is different from x's allocator, the elements are moved. Otherwise, no elements are constructed (their ownership is directly transferred). x is left in an unspecified but valid state. (6) initializer list constructor Constructs a container with a copy of each of the elements in il, in the same order. |
vector<Day> day {32};
does use
|
|
|
|
32 24 -7777 |
std::vector<Day> day {32};
calls the fill constructor that creates 32 Days with default constructors.vector<double>(24,not_a_reading)
calls the fill too, to create 24 doubles and initialize each of them with -7777.vector<double> hour { temporary_unnamed_vector_object };
is optimized out, rather than moved or copied.