int main()
{
vector<int> a = { 1,3,3,3,4,5,6,6,7 };
vector<int>::iterator it_1 = a.begin();
vector<int>::iterator it_2 = a.end();
cout << "去重前的 a : ";
for (int i = 0; i < a.size(); i++)
cout << a[i];
cout << endl;
auto it = unique(it_1, it_2);
cout << "去重后的 a : ";
for (int i = 0; i < a.size(); i++)
cout << a[i];
cout << endl;
//返回指针指向 去重后容器中不重复序列的最后一个元素的下一个元素
cout << "unique返回指针的位置" << endl;
for (auto iter = it; iter < a.end(); iter++) {
cout << *iter;
}
cout << endl;
a.erase(it, a.end());
cout << "erase之后:" << endl;
for (auto iter = a.begin(); iter < a.end(); iter++) {
cout << *iter;
}
cout << endl;
return 0;
}