Skip to content

Commit eaad4fc

Browse files
authored
Mark IntRange::iterator::operator{==,!=} as const. (swiftlang#28390)
`IntRange::iterator::operator==` must be marked as `const` in order to use `OptionalTransformRange<IntRange<...>, ...>::empty` under specific conditions.
1 parent ea56a63 commit eaad4fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Basic/Range.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ class IntRange {
126126
*this -= 1;
127127
return copy;
128128
}
129-
bool operator==(iterator rhs) { return Value == rhs.Value; }
130-
bool operator!=(iterator rhs) { return Value != rhs.Value; }
129+
bool operator==(iterator rhs) const { return Value == rhs.Value; }
130+
bool operator!=(iterator rhs) const { return Value != rhs.Value; }
131131

132132
iterator &operator+=(difference_type i) {
133133
Value = Traits::addOffset(Value, i);

0 commit comments

Comments
 (0)