map, bind, lambda

Tags:

#include
#include
#include
#include
#include
#include

#include
#include
#include
#include

using namespace std;
using namespace boost::lambda;

int main()
{
typedef map map_type;
map_type m;
m[“a”] = 1;
m[“b”] = 2;

typedef map_type::value_type map_pair;
for_each(m.begin(), m.end(), cout << bind(&map_pair::first, _1) << ":" << bind(&map_pair::second, _1) << "\n"); return EXIT_SUCCESS; } [/code]

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *