[#BloombergLP-bslalg-RangeCompare] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::RangeCompare :relfileprefix: ../../ :mrdocs: This utility `struct` provides two static class methods, `equal` and `lexicographical`, for comparing two ranges of values. `equal` returns `true` if each element in one range has the same value as the corresponding element in the other range, and `false` otherwise. `lexicographical` returns 0 if the two ranges are equal, a positive value if the first range is greater than the second, and a negative value if the second range is greater than the first. A range is specified by a pair of beginning and ending iterators, with an optional length parameter. Additionally, an overload is provided for the `equal` class method that allows the end iterator for one range to be omitted. == Synopsis Declared in `<bslalg_rangecompare.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct RangeCompare; ---- == Description `equal` requires that the elements in the ranges can be compared with `operator==`. `lexicographical` requires that the elements in the ranges can be compared with `operator<`. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/RangeCompare/size_type.adoc[`size_type`] | `size_type` is an alias for an unsigned value representing the size of an object or the number of elements in a range. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/RangeCompare/equal-0f.adoc[`equal`] | `equal` overloads | xref:BloombergLP/bslalg/RangeCompare/lexicographical-02.adoc[`lexicographical`] | `lexicographical` overloads |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#