Subject: Re: [boost] Geometry and spatial indexes, my opinion
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2008-10-09 15:46:48
-- Patrick Mihelich wrote:
>On the other hand, I'm worried to see that the geometry::point
>implementation (at least the version included with SpatialIndexes)
>only compile-time indexing. I think we must also have a
>concept, to which a particular point type may or may not conform.
>RuntimeIndexable would require an indexing operator, so it can only
>modeled by homogeneous points. Iterators via begin() and end() could be
>useful as well. I have a couple of reasons for wanting this, as usual
>motivated by high dimensional spaces...
I personally believe that runtime indexable is preferable to compile
time only. It is like defining an array that is only allowed to take
compile time constants as indexes. How useful is that array? I don't
believe that when a compile time constant is specified as the runtime
index into a point that the compiler will be challenged to inline the
accessor function and convert the index directly to an offset within the
point data type when it is optimizing the code. I rely heavily on the
compiler to inline and optimize in these cases to eliminate the runtime
overhead of the abstractions I want to create, and the compiler
generally doesn't disappoint me and is improving all the time.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk