Boost logo

Geometry :

Subject: [ggl] pre-/post-increment op on iterators
From: Bruno Lalande (bruno.lalande)
Date: 2009-04-28 08:02:22


Hi,

> Yes, boost::foreach is a good idea but perhaps it's too big revolution
> in terms of C++ programmers habits, similarly why std::for_each is
> rarely used (in general) :-) for/while loops still are preferred.

Personally, the reason why I don't use it much is that I don't find it
convenient to have to explicit declare the value_type. For example, to
iterate on a vector<pair<int, pair<float, float> > > I have to write
something like:

BOOST_FOREACH(pair<int, pair<float, float> > p, v)

I find it much more convenient to use std::for_each and a functor, or
a hand-written loop with BOOST_AUTO. But maybe I missed something that
would ease the use of boost::foreach is that case?

Bruno


Geometry list run by mateusz at loskot.net