Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
The models of Difference are used to calculate the difference between 2 keys along the same dimension. That difference is expressed in a
Unit chosen by the user. Very often, the difference consist in a simple substraction of the coordinates of 2 keys along the dimenion specified.
The models of Difference shall publicly provide the following interfaces:
|Legend||A model of Difference|
|Legend||The key type of a spatial container.|
|Legend||The type unit chosen to express a difference.|
|Require||Returns the difference (or very often, the substraction) of |
If you have build your current container based on spatial::paren_less, spatial::bracket_less, spatial::iterator_less or spatial::accessor_less, and if you wish to use your container for nearest neighbor search, then you might not need to define a new Difference functor: the library will be able to deduce the right functor, based on the comparators used in the container.