Thread overview
[Issue 15230] Inconsistent std.range.SortedRange predicate checks
Oct 26, 2015
Jack Stouffer
Oct 26, 2015
John Colvin
Jul 21, 2017
Vladimir Panteleev
Jul 21, 2017
Vladimir Panteleev
Sep 29, 2019
Berni
Sep 29, 2019
Dlang Bot
Oct 02, 2019
Dlang Bot
October 26, 2015
https://issues.dlang.org/show_bug.cgi?id=15230

Jack Stouffer <jack@jackstouffer.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jack@jackstouffer.com

--- Comment #1 from Jack Stouffer <jack@jackstouffer.com> ---
I would consider this as "working as intended", as the checks are only supposed to happen in debug mode. In a PR of mine, I asked @schveiguy if it made any sense to have any checks in a function that is supposed to be assuming something. He said it's strange, but it's nice to have something that double checks for you, in debug mode only.

--
October 26, 2015
https://issues.dlang.org/show_bug.cgi?id=15230

--- Comment #2 from John Colvin <john.loughran.colvin@gmail.com> ---
(In reply to Jack Stouffer from comment #1)
> I would consider this as "working as intended", as the checks are only supposed to happen in debug mode. In a PR of mine, I asked @schveiguy if it made any sense to have any checks in a function that is supposed to be assuming something. He said it's strange, but it's nice to have something that double checks for you, in debug mode only.

It's fine to have extra runtime checks in debug mode that check data, but I think the API should not change. The predicate should either always be verified to be valid or be optional.

--
July 21, 2017
https://issues.dlang.org/show_bug.cgi?id=15230

--- Comment #3 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Verifying the predicate statically regardless of -debug does sound like a good idea.

--
July 21, 2017
https://issues.dlang.org/show_bug.cgi?id=15230

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |freeslave93@gmail.com

--- Comment #4 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
*** Issue 15537 has been marked as a duplicate of this issue. ***

--
September 29, 2019
https://issues.dlang.org/show_bug.cgi?id=15230

Berni <dlang@croco-puzzle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang@croco-puzzle.com

--- Comment #5 from Berni <dlang@croco-puzzle.com> ---
An other solution might be, to add an (optional) option parameter, like in
https://dlang.org/phobos/std_range.html#transposed. The parameter decides if
sortedness should be striktly checked (O(n)), roughly checked (O(log(n)) or
assumed.

--
September 29, 2019
https://issues.dlang.org/show_bug.cgi?id=15230

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
@crocopaw created dlang/phobos pull request #7205 "Fix Issue 15230 - Inconsistent std.range.SortedRange predicate checks" fixing this issue:

- Fix Issue 15230 - Inconsistent std.range.SortedRange predicate checks

https://github.com/dlang/phobos/pull/7205

--
October 02, 2019
https://issues.dlang.org/show_bug.cgi?id=15230

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #7205 "Fix Issue 15230 - Inconsistent std.range.SortedRange predicate checks" was merged into master:

- 58c3a7573865f70f5c25b15af4a70257b3a8998e by Berni:
  Fix Issue 15230 - Inconsistent std.range.SortedRange predicate checks

https://github.com/dlang/phobos/pull/7205

--