目前,当我需要多次使用 vector.push_back()
时,我正在使用以下代码:
std::vector<int> TestVector;
TestVector.push_back(2);
TestVector.push_back(5);
TestVector.push_back(8);
TestVector.push_back(11);
TestVector.push_back(14);
有没有一种方法只使用vector.push_back()
一次,并将多个值传递到向量中?