Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Implement opCmp for Nullable objects