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
This is the correct behaviour. The fix is simple: raw pointers should be included in the list of comparable types, that is, is_comparable_type<T> should return true when T = T*.
Can be fixed by simply adding std::is_pointer<T>::value to the definition of is_comparable_type, ie:
When comparing two pointer properties, the wrong result will always be returned. To clarify, assuming some two objects with a raw pointer property:
The reason for this is that the following specialization of
compare_equal
is always selected in the case of raw pointer properties:This is the wrong specialization, because it results in comparing the addresses of two pointers, instead of the values of the pointers.
It should select the following specialization instead:
This is the correct behaviour. The fix is simple: raw pointers should be included in the list of comparable types, that is,
is_comparable_type<T>
should return true whenT = T*
.Can be fixed by simply adding
std::is_pointer<T>::value
to the definition ofis_comparable_type
, ie:Note: this problem also affects the less-than comparison, but the fix to
is_comparable_type
also fixes that one.The text was updated successfully, but these errors were encountered: