QStringTokenizer: remove unused op==(it, it)

Its presence is a remnant of a time (Qt 5) when
QStringTokenizer::sentinel could optionally be
QStringTokenizer::iterator (for pre-C++17 code).

Remove, since it a) compiles bad user code, b) acts as a bad c'n'p
source for others and c) removes a nasty Q_ASSERT()-in-noexcept.

[ChangeLog][Potentially Source-Incompatible Changes] The relational
operators between QStringTokenizer::iterators have been
removed. Correct code didn't need them since Qt 6.0, when
QStringTokenizer::end() started returning ::sentinel instead of
::iterator unconditionally. You can still compare iterator and
sentinel, just not iterator and iterator.

Change-Id: I83d1dcac98b52526dabc6327cfd93956afd24e97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2024-08-27 08:40:25 +02:00
parent 2d87bb7d2e
commit e0d93ed490

View File

@ -72,10 +72,6 @@ public:
iterator& operator++() { advance(); return *this; }
iterator operator++(int) { auto tmp = *this; advance(); return tmp; }
friend constexpr bool operator==(const iterator &lhs, const iterator &rhs) noexcept
{ return lhs.current.ok == rhs.current.ok && (!lhs.current.ok || (Q_ASSERT(lhs.tokenizer == rhs.tokenizer), lhs.current.state == rhs.current.state)); }
friend constexpr bool operator!=(const iterator &lhs, const iterator &rhs) noexcept
{ return !operator==(lhs, rhs); }
friend constexpr bool operator==(const iterator &lhs, sentinel) noexcept
{ return !lhs.current.ok; }
friend constexpr bool operator!=(const iterator &lhs, sentinel) noexcept