[Issue 17032] New: Sortedness of a range should be propagated
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Dec 25 22:42:49 PST 2016
https://issues.dlang.org/show_bug.cgi?id=17032
Issue ID: 17032
Summary: Sortedness of a range should be propagated
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: greeenify at gmail.com
Since https://github.com/dlang/phobos/pull/4907, find has a specialization for
SortedRange, however if another range function was applied before (e.g. `take`)
the check won't work.
It's probably possible to check the type and see if there's a SortedRange
occuring. If so a simple solution would be to iterate towards it and check
whether the struct on the way have a `propagatesSortedness` property.
However this of course won't work for something like `retro`.
--
More information about the Digitalmars-d-bugs
mailing list