The C++ Standard Library class template vector
allows you to create a new vector
object that’s initialized with the contents of an existing vector
. Line 46 creates a vector
object integers3
and initializes it with a copy of integers1
. This invokes vector
’s so-called copy constructor to perform the copy operation. You’ll learn about copy constructors in detail in Chapter 10. Lines 48–50 output the size and contents of integers3
to demonstrate that it was initialized correctly.