While I'm reading some codes for algorithms, i wonder how the code below works in C++.
#include <vector>
std::vector<int> globalVector;
void initVector() {
globalVector = std::vector<int>(5,0);
}
I learned that vector assignment '=' operation is a copy operation, but how the uninitialized global vector is copied? Is it a just series of resizing of the vector and copying the contents of counterpart? Thank you!