This was broken by #1429 (4ef380f10fef7523761c73bc4cb2aeec68fac6fd). Previously, plKey's ordering operators were provided by the implicit conversion to plKeyImp*, meaning that plKeys were ordered by their fKeyData pointers. When this was replaced by the conversion to bool, the ordering operators unintentionally also changed - plKeys were now ordered only by their bool value, so all non-null plKeys were converted to the same value (true) and had no ordering relative to each other! This made anything that uses the ordering operators misbehave, such as stdlib containers like std::set.
This change adds explicit plKey ordering operators that match the previous behavior.
Also includes another change I made during debugging, which makes a few plKey/plKeyData*/plKeyImp* conversions more straightforward. That turned out to be irrelevant for the fix, but it makes the code cleaner, so I left it in.
Fixes #1479.
This was broken by #1429 (4ef380f10fef7523761c73bc4cb2aeec68fac6fd). Previously,
plKey
's ordering operators were provided by the implicit conversion toplKeyImp*
, meaning thatplKey
s were ordered by theirfKeyData
pointers. When this was replaced by the conversion tobool
, the ordering operators unintentionally also changed -plKey
s were now ordered only by theirbool
value, so all non-nullplKey
s were converted to the same value (true
) and had no ordering relative to each other! This made anything that uses the ordering operators misbehave, such as stdlib containers likestd::set
.This change adds explicit
plKey
ordering operators that match the previous behavior.Also includes another change I made during debugging, which makes a few
plKey
/plKeyData*
/plKeyImp*
conversions more straightforward. That turned out to be irrelevant for the fix, but it makes the code cleaner, so I left it in.