#include #include #include using namespace std; void PrintOut(const pair &p) { cout << p.first << " goes " << p.second << endl; } int main(int argc, char **argv) { map zoo; zoo["dog"] = "woof"; zoo["cat"] = "meow"; zoo["fish"] = "blub"; zoo["seal"] = "ow ow ow"; zoo["fox"]; // ♫ WHAT DOES THE FOX SAY? ♫ auto it = zoo.find("fox"); if (it == zoo.end()) cout << "not found" << endl; else cout << "found" << endl; cout << "iterating:" << endl; for_each(zoo.begin(), zoo.end(), &PrintOut); return 0; }