C++20 replaces the individual <
,<=
,>
,>=
operators of std::vector
(and of many other standard classes) with a single <=>
.
Internally it tries to use <=>
to compare the elements, and falls back to the old operators if the type doesn't overload <=>
.
Since you have a non-explicit operator bool
, applying <=>
converts both operands to bool and compares those. The fix is to make operator bool
explicit
(which is a good idea in general) (so that <=>
fails and vector
falls back to the old operators), and/or replace <
,<=
,>
,>=
with <=>
(which is also a good idea in general).