Summary: isSorted fails with predicate "a.length < b.length ?
                    true : a < b"
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Jonathan M Davis <> 2012-07-29 19:44:44 
PDT ---
This code fails the assertion:

import std.algorithm;
import std.stdio;

void main()
    string[] x = ["_10", "_20", "_100"];
    assert(isSorted!"a.length < b.length ? true : a < b"(x));

However, it _is_ sorted according to the predicate, so the assertion should

I ran into this because sort throws an AssertError sorting ["_100", "_10",
"_20"] using that predicate, claiming that the sorting failed, when it actually
succeeded. So, not only is this messing up isSorted, but it messes up sort in
non-release mode.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to