#include #include #include #include #include "Tracer.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; map::iterator it; cout << "insert(a,b):" << table[e] << endl; table.insert(pair(a, b)); cout << "\nassign(c=d):" << table[e] << endl; table[c] = d; cout << "\nassign(e=f):" << table[e] << endl; table[e] = f; cout << "\ntable[e]:" << table[e] << endl; it = table.find(c); cout << "\nPrintOut(*it), where it = table.find(c)" << endl; PrintOut(*it); cout << "iterating:" << endl; for_each(table.begin(), table.end(), &PrintOut); cout << endl; return EXIT_SUCCESS; }