Skip to content

Commit 0f0d607

Browse files
committed
Add const to begin() accessor of ranget
It was previously impossible to iterate over a `const` range, because you couldn't call `.begin()` on it. This fixes that issue. Changing this to `const` does not allow the internals of the range to be mutated, as it returns a copy of the begin iterator, not a reference to it.
1 parent 5f639bd commit 0f0d607

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/range.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ struct ranget final
365365
return begin_value == end_value;
366366
}
367367

368-
iteratort begin()
368+
iteratort begin() const
369369
{
370370
return begin_value;
371371
}

0 commit comments

Comments
 (0)