|
Geometry : |
Subject: [ggl] combine
From: Adam Wulkiewicz (adam.wulkiewicz)
Date: 2011-03-29 14:51:03
Bruno Lalande wrote:
> Hi,
>
> Btw, to be completly honest, intersection_inserter should be the
> name of an object, not function. Function's name should be the verb:
>
>
> I agree, it is confusing.
> So everybody agrees on this last moment renaming "inserter" to
> "insert" ?
>
>
> I had forgotten to reply at that moment. I'm not sure to agree with
> this. I don't see any reason to name it with a verb, as conceptually
> it's neither an object or a function, it's a functor. The underlying
> type could be an object or an actual function, it wouldn't change its
> name. BTW we could very well migrate from function to class in a future
> release for some reason, that wouldn't change how we name this functor
> conceptually (for compatibility reasons, to start with).
But intersection_inserter
inline OutputIterator intersection_inserter(
Geometry1 const& geometry1,
Geometry2 const& geometry2,
OutputIterator out);
is a function. Moreover it copies the intersection of the geometries
into the output iterator. It inserts only if you pass e.g.
std::back_inserter as a parameter. However it works diferently from
algorithms like std::copy which operates on ranges because it copies
only one object. It works like:
vect.push_back(geometry::intersection(geometry1, geometry2));
or am I missing something?
Regards,
Adam
Geometry list run by mateusz at loskot.net