1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
// set::rbegin/rend
#include <iostream>
#include <set>
int main ()
{
int myints[] = {21,64,17,78,49};
std::set<int> myset (myints,myints+5);
std::set<int>::reverse_iterator rit;
std::cout << "myset contains:";
for (rit=myset.rbegin(); rit != myset.rend(); ++rit)
std::cout << ' ' << *rit;
std::cout << '\n';
return 0;
}
|