Boost logo

Boost :

From: Fredrik Blomqvist (fredrik_blomqvist_at_[hidden])
Date: 2004-05-04 19:56:12


Hi,

I think it would be convenient if one could treat std::pair as a boost
two-tuple.
Both tuples::tie and tuple assignment already work with std::pair but I've
noticed that the get<> accessor doesn't.

So, I propose a simple extension to tuples::get<> with the obvious
semantics:
boost::get<0>(p) == p.first
boost::get<1>(p) == p.second

The only reference I found in the archives was a post by Tomas Witt early
2002.
"Tuple extension proposal":
http://lists.boost.org/MailArchives/boost/msg25582.php

Should I submit the code I've got or does something like this already exist
somewhere?
(I've tested the code using VC7.1, it doesn't rely on PTS although
member-templates)

Regards
// Fredrik Blomqvist


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk