[#BloombergLP-bslalg-RangeCompare-lexicographical-02] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RangeCompare.adoc[RangeCompare]::lexicographical :relfileprefix: ../../../ :mrdocs: `lexicographical` overloads == Synopses Declared in `<bslalg_rangecompare.h>` 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> static int xref:BloombergLP/bslalg/RangeCompare/lexicographical-07.adoc[lexicographical]( INPUT_ITER start1, INPUT_ITER end1, INPUT_ITER start2, INPUT_ITER end2); ---- [.small]#xref:BloombergLP/bslalg/RangeCompare/lexicographical-07.adoc[_» more..._]# Same as the preceding `lexicographical` overload, taking explicit range lengths. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> static int xref:BloombergLP/bslalg/RangeCompare/lexicographical-04.adoc[lexicographical]( INPUT_ITER start1, INPUT_ITER end1, xref:BloombergLP/bslalg/RangeCompare/size_type.adoc[size_type] length1, INPUT_ITER start2, INPUT_ITER end2, xref:BloombergLP/bslalg/RangeCompare/size_type.adoc[size_type] length2); ---- [.small]#xref:BloombergLP/bslalg/RangeCompare/lexicographical-04.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#