STL Samples : <list>
双方向リスト
list

#include <iostream>
#include <list>
#include "to_string.h"
#include "foo.h"
using namespace std;
void std_list() {
cout << "list" << endl;
list<Foo> lf;
for ( int i = 1; i < 6; i++ ) lf.push_back(i%3);
cout << to_string(lf.begin(), lf.end()) << endl;
cout << "reverse..." << endl;
lf.reverse();
cout << to_string(lf.begin(), lf.end()) << endl;
cout << "sort..." << endl;
lf.sort();
cout << to_string(lf.begin(), lf.end()) << endl;
cout << "unique..." << endl;
lf.unique();
cout << to_string(lf.begin(), lf.end()) << endl;
}
This entry was posted
on Thursday, March 30th, 2006 at 3:26 pm and is filed under reference.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.