
28 Oct
2008
28 Oct
'08
1:05 p.m.
Quoting Mathias Gaunard <mathias.gaunard@ens-lyon.org>:
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.