双方向リスト
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;
}
επιστημη 2006-03-30