#include <iostream>
#include <map>
#include <string>
#include <algorithm>
using std::map;
using std::cout;
using std::endl;
int main()
{
map<std::string, double> mp{ { "c++", 3.14 }, { "c", 5.18 } };
for_each(mp.begin(), mp.end(), [](const map<std::string, double>::value_type& element) {
cout << element.first << ": " << element.second << endl;
});
return 0;
}
/*
run:
c: 5.18
c++: 3.14
*/