I have a map where I\'d like to perform a call on every data type object member function. I yet know how to do this on any sequence but, is it possible to do it on an associativ
Here is an example of how you can use for_each for a map.
std::map map; map.insert(std::pair(1, 2)); map.insert(std::pair(2, 4)); map.insert(std::pair(3, 6)); auto f = [](std::pair it) {std::cout << it.first + it.second << std::endl; }; std::for_each(map.begin(), map.end(), f);