Thread overview
Builtin Support for Comparison Function for Primitive Types
May 02, 2015
Per Nordlöw
May 02, 2015
Per Nordlöw
May 02, 2015
Per Nordlöw
May 02, 2015
Why doesn't std.algorithm.comparison.cmp support primitive types such as

    assert(cmp(0,1) == true);

?
May 02, 2015
On Saturday, 2 May 2015 at 08:29:11 UTC, Per Nordlöw wrote:
> Why doesn't std.algorithm.comparison.cmp support primitive types such as
>
>     assert(cmp(0,1) == true);
>
> ?

Correction if mean

      assert(cmp(0,1) == -1);
May 02, 2015
On Saturday, 2 May 2015 at 08:29:11 UTC, Per Nordlöw wrote:
> Why doesn't std.algorithm.comparison.cmp support primitive types such as
>
>     assert(cmp(0,1) == true);
>
> ?

I just found some forgotten code of my that solves it through

    import std.range: only;
    assert(cmp(only(0), only(1)) == -1);

Why the detour over std.range.only()?