[geos-devel] use of const in GeometryFactory constructor

strk strk at keybit.net
Thu Oct 9 05:32:40 EDT 2003


GeometryFactory(PrecisionModel * newPrecisionModel, int SRID)
Will copy the PrecisionModel arg into private space.

The arguments naming convention used elsewere makes you think
the PresionModel object has to be created on purpose and thus
that you'll have to forget about it. Anyway this is not the
actual implementation and I don't know about usage of it
by other GEOS parts.

As a test, I tried to "formalize" the implementation behaviour
adding a 'const' in front of the first arg both in GeometryFactory.cpp
and geom.h (and changing the name of it to disambiguate meaning).

The library resulted by this was corrupted, when trying to run a
linked executable I got:
./example: error while loading shared libraries: ./example: undefined symbol:
__Q24geos15GeometryFactoryPQ24geos14PrecisionModeli

Question 1: do you think using 'const' there is the right way to go ?

Question 2: do you think I've a bogus compiler ? (gcc-2.96)

--strk;





More information about the geos-devel mailing list