Boost logo

Boost :

From: Giuseppe Ottaviano (giuott_at_[hidden])
Date: 2007-02-09 06:01:58

I work often with containers of tuples or pairs, using stl and boost
algorithms. Accessing elements with boost lambda is a bit cumbersome,
requiring syntax like
bind(&pair<int, int>::first, _1)
I have written a small adaptor to make get<> work with lambda
expressions, so that the syntax becomes
It works for std::pair and boost::tuple.

It is only a suggestion, i do not know if it handles correctly consts,
references, etc, and has been tested only on gcc 4.1.2. I've posted the
code on boost vault:

Can something like this be implemented in future versions of Lambda?

Giuseppe Ottaviano

Boost list run by bdawes at, gregod at, cpdaniel at, john at