blob: 83d04ea54309b7ab1d9cd568fe921219933d5f04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "myobject.h"
#include <algorithm>
#include <iostream>
#include <list>
using namespace std;
int main(int argc, char **argv)
{
MyObject obj;
list<int> lst;
lst.push_back(1);
lst.push_back(2);
lst.push_back(3);
lst.push_back(4);
lst.push_back(5);
lst.push_back(6);
lst.push_back(7);
lst.push_back(8);
lst.push_back(9);
reverse(lst.begin(), lst.end());
for (list<int>::iterator it=lst.begin(); it != lst.end(); ++it)
cout << *it << ", ";
cout << endl;
return 0;
}
|