Skip to content

Commit f97a674

Browse files
committed
Made operator== and operator!= friend functions for stdex::cvector::iterator_base to accomodate C++20 changes, as suggested by @jfalcou
1 parent da011f3 commit f97a674

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/ctpg.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ namespace stdex
124124
constexpr it_type* cast() { return static_cast<it_type*>(this); }
125125
constexpr const it_type* cast() const { return static_cast<const it_type*>(this); }
126126

127-
constexpr bool operator == (const it_type& other) const { return cast()->ptr == other.ptr; }
128-
constexpr bool operator != (const it_type& other) const { return cast()->ptr != other.ptr; }
127+
friend constexpr bool operator == (const it_type& a, const it_type& b) { return a.cast()->ptr == b.cast()->ptr; }
128+
friend constexpr bool operator != (const it_type& a, const it_type& b) { return a.cast()->ptr != b.cast()->ptr; }
129129
constexpr it_type operator - (size_type amount) const { return it_type{ cast()->ptr - amount }; }
130130
constexpr size_type operator - (const it_type& other) const { return size_type(cast()->ptr - other.ptr); }
131131
constexpr it_type operator + (size_type amount) const { return it_type{ cast()->ptr + amount }; }

0 commit comments

Comments
 (0)