Boost logo

Boost :

From: Giovanni P. Deretta (lordshoo_at_[hidden])
Date: 2005-04-27 09:49:32

David Abrahams wrote:
> "Giovanni P. Deretta" <lordshoo_at_[hidden]> writes:
>>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.
>> 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,

Hum, I can't find it in boost-1.32 nor in the CVS... link?

Giovanni P. Deretta

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