首页 > 代码库 > c++ list reverse_iterator

c++ list reverse_iterator

#pragma warning(disable:4786)#include <set>#include <iostream>using namespace std ;typedef set<int> SET_INT;int main() {  SET_INT s1;  SET_INT::reverse_iterator i;  cout << "s1.insert(5)" << endl;  s1.insert(5);  cout << "s1.insert(10)" << endl;  s1.insert(10);  cout << "s1.insert(15)" << endl;  s1.insert(15);  cout << "s1.insert(20)" << endl;  s1.insert(20);  // displays: 20,15,10,5  for (i=s1.rbegin();i!=s1.rend();i++)     cout << "s1 has " << *i << " in its set." << endl;}

 

c++ list reverse_iterator