
-- Patrick Mihelich wrote:
On the other hand, I'm worried to see that the geometry::point implementation (at least the version included with SpatialIndexes) supports only compile-time indexing. I think we must also have a RuntimeIndexable concept, to which a particular point type may or may not conform. RuntimeIndexable would require an indexing operator[], so it can only be 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. Luke