Template Struct NearestNeighbors
Defined in File algorithm.hpp
Struct Documentation
Gets the elements nearest to the specified value in the container.
The container must have random access iterators and be ordered.
Public Types
Type used to order the container.
Public Functions
- Parameters
begin – The beginning of the container search.
end – The end (one past the last element) of the container search.
t – The element to find neighbors of.
- Returns
Pair of iterators representing the nearest elements to
t. Iftis before all elements then return will be{end, begin}; iftis after all elements return will be{end - 1, end}. If t is exactly matched, both iterators will be to the last such element that matchedt. Finally, iftis between two elements then the return will be the elements before and aftert.