
"Giovanni P. Deretta" <lordshoo@gmail.com> writes:
Hi,
I have been using a small extension to the tuple library 'get' function, that I have found very handy. It allows the extraction of an element of a tuple by specifying its type instead of the index. Example:
given the tuple boost::tuple<type1, type2, type3>
get<type1> returns the first element of the tuple of that type.
This allows one to write more self describing code: you don't need to look up the tuple element type when you find an indexed get function buried deep inside some code. This is especially useful with nested tuples where for example 'get<3>(get<5>(get<0>(my_tuple)))' looks more like line noise than real code :).
You might look at c:/boost/boost/python/detail/tuple_extract.hpp HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com