C++11 vector constructor copy vs range?
问题 I can't understand the advantages of or differences between vector copy constructors and range constructors. When I construct three vectors like this: vector<int> FirstVec(3, 911); //fill constructor vector<int> SecondVec(FirstVec.begin(), FirstVec.end()); //range constructor vector<int> ThirdVec(FirstVec); //copy constructor The contents of SecondVec and ThirdVec are exactly the same. Are there any scenarios in which using one of them has advantages? Thank you. 回答1: The range constructor is