📜  如何在 C++ 代码示例中对向量进行切片

📅  最后修改于: 2022-03-11 14:44:45.393000             🧑  作者: Mango

代码示例1
vector values = {35, 28, 34, 23};
  vector res;
  // slice vector `values` from index 1 to the end
  // and assgin the result to `res`
  res.assign(values.begin() + 1, values.end());
  // equivalent
  vector res1(values.begin() + 1, values.end());