Skip to content

Commit f3514b3

Browse files
committed
Making MSVC happy
1 parent ee37680 commit f3514b3

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

lib/inc/sys_string/utf_view.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ namespace sysstr
9898
}
9999

100100
template<std::equality_comparable_with<It> RIt, std::sentinel_for<RIt> EndRIt>
101-
friend constexpr bool operator==(const utf_iterator & lhs, const utf_iterator<OutputEnc, RIt, EndRIt, Direction> & rhs)
102-
{ return lhs.m_char_idx == rhs.m_char_idx && lhs.m_next == rhs.m_next; }
101+
constexpr bool operator==(const utf_iterator<OutputEnc, RIt, EndRIt, Direction> & rhs) const
102+
{ return this->m_char_idx == rhs.m_char_idx && this->m_next == rhs.m_next; }
103103

104-
friend constexpr bool operator==(const utf_iterator & lhs, std::default_sentinel_t)
105-
{ return !lhs; }
104+
constexpr bool operator==(std::default_sentinel_t) const
105+
{ return !*this; }
106106

107107
const It storage_next() const
108108
{ return this->m_next; }
@@ -188,11 +188,11 @@ namespace sysstr
188188
}
189189

190190
template<std::equality_comparable_with<It> RIt, std::sentinel_for<RIt> EndRIt>
191-
friend constexpr bool operator==(const utf_iterator & lhs, const utf_iterator<utf32, RIt, EndRIt, Direction> & rhs)
192-
{ return lhs.m_next == rhs.m_next && bool(lhs.m_value) == bool(rhs.m_value); }
191+
constexpr bool operator==(const utf_iterator<utf32, RIt, EndRIt, Direction> & rhs) const
192+
{ return this->m_next == rhs.m_next && bool(this->m_value) == bool(rhs.m_value); }
193193

194-
friend constexpr bool operator==(const utf_iterator & lhs, std::default_sentinel_t)
195-
{ return !lhs.m_value; }
194+
constexpr bool operator==(std::default_sentinel_t) const
195+
{ return !this->m_value; }
196196

197197
It storage_next() const
198198
{ return this->m_next; }
@@ -307,16 +307,16 @@ namespace sysstr
307307
}
308308

309309
template<std::equality_comparable_with<It> RIt, std::sentinel_for<RIt> EndRIt>
310-
friend constexpr bool operator==(const utf_iterator & lhs, const utf_iterator<OutputEnc, RIt, EndRIt, Direction> & rhs)
311-
{ return lhs.m_char_idx == rhs.m_char_idx && lhs.m_current == rhs.m_current; }
310+
constexpr bool operator==(const utf_iterator<OutputEnc, RIt, EndRIt, Direction> & rhs) const
311+
{ return this->m_char_idx == rhs.m_char_idx && this->m_current == rhs.m_current; }
312312

313313

314-
friend constexpr bool operator==(const utf_iterator & lhs, std::default_sentinel_t)
315-
{ return !lhs; }
314+
constexpr bool operator==(std::default_sentinel_t) const
315+
{ return !*this; }
316316

317-
const It storage_current() const
317+
It storage_current() const
318318
{ return this->m_current; }
319-
const It storage_next() const
319+
It storage_next() const
320320
{ return this->m_next; }
321321
EndIt storage_last() const
322322
{ return this->m_last; }
@@ -418,11 +418,11 @@ namespace sysstr
418418
}
419419

420420
template<std::equality_comparable_with<It> RIt, std::sentinel_for<RIt> EndRIt>
421-
friend constexpr bool operator==(const utf_iterator & lhs, const utf_iterator<utf32, RIt, EndRIt, Direction> & rhs)
422-
{ return lhs.m_current == rhs.m_current; }
421+
constexpr bool operator==(const utf_iterator<utf32, RIt, EndRIt, Direction> & rhs) const
422+
{ return this->m_current == rhs.m_current; }
423423

424-
friend constexpr bool operator==(const utf_iterator & lhs, std::default_sentinel_t)
425-
{ return lhs.m_current == lhs.m_last; }
424+
constexpr bool operator==(std::default_sentinel_t) const
425+
{ return this->m_current == this->m_last; }
426426

427427

428428
It storage_current() const

0 commit comments

Comments
 (0)