phobos icon indicating copy to clipboard operation
phobos copied to clipboard

Added isPartiallyOrdered in std.traits

Open Bolpat opened this issue 7 years ago • 12 comments

In short, isPartiallyOrdered!(S, T) compiles, iff the ordering exists, and it returns false iff the comparison s <= t || s >= t between values s and t of type S and T cannot be false from a static type analysis point of view. It is needed order to implement #6499 properly and can be useful in the future.

Bolpat avatar May 17 '18 22:05 Bolpat

Thanks for your pull request and interest in making D better, @Bolpat! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + phobos#6513"

dlang-bot avatar May 17 '18 22:05 dlang-bot

I don't know why Jenkins fails. The error seems not to be related with this PR; it hardly is as this PR is addition-only. Can the error be ignored?

Bolpat avatar May 17 '18 23:05 Bolpat

Yeah sadly the Ocean error seems to be appearing on a few other PRs too.

wilzbach avatar May 18 '18 01:05 wilzbach

Disabled it temporarily -> https://github.com/dlang/ci/pull/208 (after the next push, Jenkins should be green again).

wilzbach avatar May 18 '18 01:05 wilzbach

@ZombineDev maybe a quick review?

Bolpat avatar May 21 '18 15:05 Bolpat

Is this assertion failure expected ?

unittest
{
    struct F
    {
        float f;
        alias f this;
    }
    static assert(isPartiallyOrdered!F == isPartiallyOrdered!float);
}

ghost avatar May 24 '18 20:05 ghost

Thank you @BBasile, the answer is no. I missed that and it's fixed now.

Bolpat avatar May 27 '18 00:05 Bolpat

@Bolpat Is this addition still required?

cc @atilaneves

RazvanN7 avatar Apr 29 '21 09:04 RazvanN7

@RazvanN7 What do you mean by required? Has something similar been added and I didn't notice?

Bolpat avatar Apr 29 '21 19:04 Bolpat

I saw that PR #6499 was closed so I wanted to make sure that you are still pursuing this. Will merging this PR unblock #6499?

RazvanN7 avatar May 03 '21 09:05 RazvanN7

@RazvanN7, I cannot guarantee it, but it is likely to be unblocked by it. However, note that slice comparison is broken in the same way. I'll work on it soon (the next days).

Edit: This should probably go to core and std.traits should have a public import of it. That way, array comparison can use it.

Bolpat avatar May 19 '21 14:05 Bolpat

@Bolpat Have you made any progress on this?

RazvanN7 avatar Mar 08 '22 11:03 RazvanN7