BloombergLP::bslalg::RangeCompare

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>

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

NameDescription
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

NameDescription
equal equal overloads
lexicographical lexicographical overloads