Boost logo

Geometry :

Subject: [ggl] for each
From: feverzsj
Date: 2011-09-30 07:07:51


hi, Bruno

>> find_if is a generic algorithms that doesn't care about the actual
>> iterator type, so probably no need to develop a special one for
>> geometries. Instead, we should probably have special iterators. But I
>> assume Boost.Bind and Boost.Lambda can already help a lot without further
>> development.

yes, of course. But the job required may differ a lot for different
geometry. The extra iterator facility could also be ineffeicient for some
geometries. Plus, the behaviour of std::find_if is to return iterator for
compare with end iterator, while some geometries do not natively support
that.
So my point is "immediately return on success", something may look like"bool
for_each_point/segament_until(g, pred)" to iterator until pred() return
true.

regards, zsj


Geometry list run by mateusz at loskot.net