Compare each element in the range beginning at the specified start1 position and ending immediately before the specified end1 position, to the corresponding element in the range beginning at the specified start2 position and ending immediately before the specified end2 position. Optionally specify the length of each range, length1 and length2. Return a negative value if the first range compares lexicographically less than the second range, 0 if they are the same length and compare lexicographically equal, and a positive value if the first range compares lexicographically greater than the second range. The behavior is undefined unless length1 is either unspecified or equals the length of the range [start1, end1)], and length2 is either unspecified or equals the length of the range [start2, end2)]. Note that this implementation uses std::memcmp for unsigned character comparisons, std::wmemcmp for wide character comparisons, and operator< for all other types.
Synopsis
Declared in <bslalg_rangecompare.h>
template<class INPUT_ITER>
static
int
lexicographical(
INPUT_ITER start1,
INPUT_ITER end1,
INPUT_ITER start2,
INPUT_ITER end2);
Created with MrDocs