我想复制矢量的内容,并希望它们被附加在原始矢量的末尾,即 v[i]=v[i+n] for i=0,2,...,n-1
v[i]=v[i+n] for i=0,2,...,n-1
我正在寻找一种很好的方法,而不是循环.我看到std::vector::insert但迭代版本禁止迭代器*this(即行为未定义).
std::vector::insert
*this
我也尝试std::copy如下(但它导致分段错误):
std::copy
copy( xx.begin(), xx.end(), xx.end());
c++ stl stdvector c++11
c++ ×1
c++11 ×1
stdvector ×1
stl ×1