#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
vector <int> a{ 1, 2, 3, 4, 5}, b(5);
//copy_backward( iterator first, iterator last, iterator) 沿反方向复制 返回一个指向复制结束位置的的迭代器
auto i = copy_backward( a.begin(), a.end(), b.end());
for(auto p = b.begin(); p != b.end(); p ++)
cout << *p << ' ';
cout << endl;
cout << "*i is " << *i;
}
C++ copy_backward
最新推荐文章于 2022-10-23 08:30:00 发布