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
The way custom comparisons are currently implemented force you to always return an integer and doesn't tell you what operation you are doing.
An example of how it can bite is that mir can't do elementwise comparisons similar to how it does addition or multiplication since it has to return an int for comparisons.
So a + a == [2, 2, 2] and a * a == [1, 1, 1] but you can't express a < a == [false, false, false].
I get the logic of only making the user create a single comparison function but maybe a possible fix would be to check if there is an opBinary for the relevant comparison operator before doing the usual opCmp logic.
The text was updated successfully, but these errors were encountered:
Anders Halager reported this on 2017-06-29T19:24:53Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=17573
Description
The text was updated successfully, but these errors were encountered: