Skip to content

Commit c0ed005

Browse files
committed
add const identifier for strong id range operators
1 parent ee0a6d6 commit c0ed005

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/libvtrutil/src/vtr_strong_id_range.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class StrongIdIterator {
9090

9191
///@brief ~ operator
9292
template<typename IdType>
93-
ssize_t operator-(const StrongIdIterator<IdType>& other) {
93+
ssize_t operator-(const StrongIdIterator<IdType>& other) const {
9494
VTR_ASSERT_SAFE(bool(id_));
9595
VTR_ASSERT_SAFE(bool(other.id_));
9696

@@ -101,19 +101,19 @@ class StrongIdIterator {
101101

102102
///@brief == operator
103103
template<typename IdType>
104-
bool operator==(const StrongIdIterator<IdType>& other) {
104+
bool operator==(const StrongIdIterator<IdType>& other) const {
105105
return id_ == other.id_;
106106
}
107107

108108
///@brief != operator
109109
template<typename IdType>
110-
bool operator!=(const StrongIdIterator<IdType>& other) {
110+
bool operator!=(const StrongIdIterator<IdType>& other) const {
111111
return id_ != other.id_;
112112
}
113113

114114
///@brief < operator
115115
template<typename IdType>
116-
bool operator<(const StrongIdIterator<IdType>& other) {
116+
bool operator<(const StrongIdIterator<IdType>& other) const {
117117
return id_ < other.id_;
118118
}
119119

0 commit comments

Comments
 (0)