#include #include #include #include #include "Tracer.h" #include "TracerWithHistory.h" using namespace std; void PrintOut(const pair &p) { cout << "printout [" << p.first << "," << p.second << "]" << endl; } int main(int argc, char **argv) { Tracer a, b, c, d, e, f; map table; cout << "\npopulating map:" << endl; map::iterator it; table.insert(pair(a, b)); table[c] = d; table[e] = f; cout << "done map!" << endl; cout << "\ntable[e]:" << endl; cout << table[e] << endl; cout << "done op[]!" << endl; cout << "\ntable.find(c):" << endl; it = table.find(c); cout << "done find(c)!" << endl; if (it != table.end()) { cout <<"found it" << endl; } cout << "\nPrintOut(*it), where it = table.find(c)" << endl; PrintOut(*it); cout << "done PrintOut(*it)!" << endl; cout << "\niterating:" << endl; for_each(table.begin(), table.end(), &PrintOut); cout << "done iterating!" << endl; cout << endl; return EXIT_SUCCESS; }