Skip to content

Commit 16fa364

Browse files
committed
More asymmetric operator==
1 parent 465539c commit 16fa364

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Utilities/DataCompression/include/DataCompression/dc_primitives.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ class ExampleAlphabet
170170
// reference
171171
reference operator*();
172172
// comparison
173-
bool operator==(const self_type& other);
173+
bool operator==(const self_type& other) const;
174174
// comparison
175-
bool operator!=(const self_type& other);
175+
bool operator!=(const self_type& other) const;
176176

177177
private:
178178
};
@@ -300,8 +300,8 @@ class ContiguousAlphabet
300300
// pointer operator->() const {return &mValue;}
301301
// reference operator[](size_type n) const;
302302

303-
bool operator==(const self_type& other) { return mValue == other.mValue && mIsEnd == other.mIsEnd; }
304-
bool operator!=(const self_type& other) { return not(*this == other); }
303+
bool operator==(const self_type& other) const { return mValue == other.mValue && mIsEnd == other.mIsEnd; }
304+
bool operator!=(const self_type& other) const { return not(*this == other); }
305305

306306
private:
307307
value_type mValue;

0 commit comments

Comments
 (0)