January 2020
Intermediate to advanced
454 pages
11h 25m
English
Let's test this container to ensure that each constructor works as expected:
int main(void){ auto alloc = std::allocator<int>(); container<int> c1; container<int> c2(alloc); container<int> c3(42, 42); container<int> c4(42); container<int> c5(c1, alloc); container<int> c6(std::move(c1)); container<int> c7(std::move(c2), alloc); container<int> c8{4, 42, 15, 8, 23, 16}; return 0;}
As shown in the preceding code block, we test our constructors by calling each one, which results in the following output:

As you can see, each constructor was successfully executed as expected.