[#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&period; `equal` returns `true` if each element in one range has the same value as the corresponding element in the other range, and `false` otherwise&period; `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&period; A range is specified by a pair of beginning and ending iterators, with an optional length parameter&period; Additionally, an overload is provided for the `equal` class method that allows the end iterator for one range to be omitted&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;rangecompare&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct RangeCompare;
----

== Description

`equal` requires that the elements in the ranges can be compared with `operator&equals;&equals;`&period;

`lexicographical` requires that the elements in the ranges can be compared with `operator&lt;`&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/RangeCompare/size_type.adoc[`size&lowbar;type`] 
| `size&lowbar;type` is an alias for an unsigned value representing the size of an object or the number of elements in a range&period;
|===


== 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]#
