1 // some simple STL tests
12 map < string, int, less<string> > mymap;
14 int i, j, size, num, age;
16 // printf("max_size = %d\n", mylist.max_size());
18 for ( i = 0; i < 2000; i++ ) {
24 deque < int > :: iterator current = mylist.begin();
25 deque < int > :: iterator last = mylist.end();
28 for ( i = 0; i < 10000000; i++ ) {
29 while ( current != last ) {
36 for ( i = 0; i < 1000; i++ ) {
37 for ( j = 0; j < size; j++ ) {
48 printf("curt age = %d\n", mymap["curt"]);
49 printf("doug age = %d\n", mymap["doug"]);
52 map < string, int, less<string> > :: iterator test = mymap.find("dan");
53 if ( test == mymap.end() ) {
54 printf("dan age = not found\n");
56 printf("dan age = %d\n", (*test).second);
59 map < string, int, less<string> > :: iterator mapcurrent = mymap.begin();
60 map < string, int, less<string> > :: iterator maplast = mymap.end();
61 while ( mapcurrent != maplast ) {
62 name = (*mapcurrent).first;
63 age = (*mapcurrent).second;
65 printf(" = %d\n", age);