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
std.typecons.Nullable should implement comparison (opCmp). This will allow sorting arrays of nullables, or structs with nullable fields.
Whether or not comparing two nullable objects is meaningful, defining an order (however arbitrary) is useful on its own, as it allows sorting for the purposes of finding unique values or for set comparisons, in a way that's often cheaper than a hash-set.
I think comparing two nullable objects is meaningful though - as with objects and arrays, null objects should sort before non-null ones.
The text was updated successfully, but these errors were encountered:
std.typecons.Nullable
should implement comparison (opCmp
). This will allow sorting arrays of nullables, or structs with nullable fields.Whether or not comparing two nullable objects is meaningful, defining an order (however arbitrary) is useful on its own, as it allows sorting for the purposes of finding unique values or for set comparisons, in a way that's often cheaper than a hash-set.
I think comparing two nullable objects is meaningful though - as with objects and arrays, null objects should sort before non-null ones.
The text was updated successfully, but these errors were encountered: