You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exposing a usertype via a custom pointer class forces the usertype to implement all comparison operators, if the custom pointer class provides them.
The code that triggers this is usertype_core.hpp:132. The code checks that T has those operators and forwards that to comparsion_operator_wrap. The problem is that comparsion_operator_wrap internally uses deref which then tries to compare the underlying type which might not have these operators implemented.
Exposing a usertype via a custom pointer class forces the usertype to implement all comparison operators, if the custom pointer class provides them.
The code that triggers this is usertype_core.hpp:132. The code checks that
T
has those operators and forwards that to comparsion_operator_wrap. The problem is thatcomparsion_operator_wrap
internally usesderef
which then tries to compare the underlying type which might not have these operators implemented.Here's a godbolt repro: https://godbolt.org/z/fEvcd889E
I would except it to be enough that the pointer type is comparable. Using
std::shared_ptr
instead of the custom pointer class works as expected.Keep up the good work!
The text was updated successfully, but these errors were encountered: