operator==
Function Usage
Determines whether a range object is equal to another one. If the addresses of the upper and lower bounds of the two ranges are the same, or the values of the upper and lower bounds are the same, the two objects are equal.
Prototype
1 | bool operator==(const Range<T>&rht) const |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
rht |
Input |
Another range object. |
Returns
true: equal; false: not equal
Constraints
None
Examples
1 2 3 4 5 6 7 8 9 | int min = 0; int max = 1024; int max2 = 1024; Range<int> range1(&min, &max); // The upper bound is 1024 and the lower bound is 0. Range<int> range2(&min, &max); // The upper bound is 1024 and the lower bound is 0. Range<int> range3(&min, &max2); // The upper bound is 1024 and the lower bound is 0. auto ret1 = range1 == range2; // true auto ret2 = range1 == range3; // true |
Parent topic: Range