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?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk