[#BloombergLP-bslalg-RangeCompare-equal-0f] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RangeCompare.adoc[RangeCompare]::equal :relfileprefix: ../../../ :mrdocs: `equal` 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 of the same length beginning at the specified `start2` position, as if using `operator==` element‐by‐element. Return `true` if every pair of corresponding elements compares equal, and `false` otherwise. Note that this implementation uses `operator==` to perform the comparisons, or bit‐wise comparison if the value type has the bit‐wise equality‐comparable trait. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> static bool xref:BloombergLP/bslalg/RangeCompare/equal-09.adoc[equal]( INPUT_ITER start1, INPUT_ITER end1, INPUT_ITER start2); ---- [.small]#xref:BloombergLP/bslalg/RangeCompare/equal-09.adoc[_» more..._]# 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, as if by using `operator==` element‐by‐element. Optionally specify the length of each range, `length1` and `length2`. Return `true` if the ranges have the same length and every element in the first range compares equal with the corresponding element in the second, and `false` otherwise. 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 `operator==` to perform the comparisons, or bit‐wise comparison if the value type has the bit‐wise equality‐comparable trait. Also note that providing lengths may reduce the runtime cost of this operation. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> static bool xref:BloombergLP/bslalg/RangeCompare/equal-0b.adoc[equal]( INPUT_ITER start1, INPUT_ITER end1, INPUT_ITER start2, INPUT_ITER end2); ---- [.small]#xref:BloombergLP/bslalg/RangeCompare/equal-0b.adoc[_» more..._]# Same as the preceding `equal` overload, taking explicit range lengths. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> static bool xref:BloombergLP/bslalg/RangeCompare/equal-0c.adoc[equal]( 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/equal-0c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#