CHAPTER5-15.cpp
上传用户:fjc899
上传日期:2007-07-03
资源大小:187k
文件大小:1k
- //文件名:CHAPTER5-15.cpp
- #include <iostream>
- #include "SLIST"
- #include <functional>
- using namespace std;
- int main()
- {
- SLIST<int> L;
- L.push_front(0);
- L.push_front(1);
- //L.insert_after(L.begin(), 2);
- copy(L.begin(), L.end(),ostream_iterator<int>(cout, " ")); // The output is 1 2 0
- cout << endl;
- SLIST<int>::iterator back = L.end();
- L.push_front( 3);
- L.push_front(4);
- L.push_front(5);
- copy(L.begin(), L.end(),ostream_iterator<int>(cout, " ")); // The output is 1 2 0 3 4 5
- cout << endl;
- }