$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Eric Niebler (eric_at_[hidden])
Date: 2005-05-11 02:34:14
Dave Steffen wrote:
> If anyone's interested: I'm playing with the idea of extending FOREACH
> in a way so that, instead of having a pair<>, you've got two separate
> variables for key and value. Maybe something like:
>
> map<int,int> m;
> ...
> FOREACH_PAIR(int key, int value, m)
> { ... }
>
> I'm having a very moderate amount of success. Anyone else playing
> with this sort of thing?
>
Can't find the reference now, but someone suggested using tie() from the
tuples library for this:
int key, int value;
BOOST_FOREACH(boost::tie(key, value), m)
{ ... }
HTH,
-- Eric Niebler Boost Consulting www.boost-consulting.com