Boost logo

Boost :

Subject: Re: [boost] tie alternative?
From: Peter Bartlett (pete_at_[hidden])
Date: 2008-10-28 09:05:22


Quoting Mathias Gaunard <mathias.gaunard_at_[hidden]>:

> David Abrahams wrote:
>
>>> What is the usecase here?
>>
>> Iterating over a range [with iterators]
>
> for(iterator_type it = boost::begin(range); it != boost::end(range); ++it)
>
> I don't think it's any uglier than it has to be.
> That could easily be made into a BOOST_FOREACH_IT macro.

In the case at hand we trying to support the case where range is a
temporary where the above implementation may be be inefficient or wrong.

Not to say you couldn't implement FOREACH_IT using the same techniques
as FOREACH if you really wanted the iterators.


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