[geos-devel] Re: [geos-commits] r3046 - trunk/src/geom

Maxime van Noppen maxime at altribe.org
Mon Jun 21 03:32:50 EDT 2010


On 06/21/2010 02:53 AM, svn_geos at osgeo.org wrote:
> Modified:
>    trunk/src/geom/GeometryCollection.cpp
> Log:
> Geometry::getGeometryN is an API function, so make it safe/checked

Is there a guideline on such topics ?

The runtime cost of an additional if() is quite high in such a method,
could there be, at least, a compilation flag to activate/deactivate such
statements ?

>From a C++ point of view, the STL (for example std::vector) is designed
to have both methods (fast: operator[], safe: std::vector::at()) to let
the programmer decide which is best (safety vs performance).

-- 
Maxime


More information about the geos-devel mailing list