Thread overview
[Issue 12188] std.algorithm.nextPermutation requires random access
Aug 11, 2014
Peter Alexander
Dec 17, 2022
Iain Buclaw
August 11, 2014
https://issues.dlang.org/show_bug.cgi?id=12188

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@erdani.com

--- Comment #3 from Andrei Alexandrescu <andrei@erdani.com> ---
It's easy to implement allBefore to return a new range type distinct (e.g.
Voldemort) from R. That range would keep the two ranges as state and would say
it's empty when whole.sameHead(right).

--
August 11, 2014
https://issues.dlang.org/show_bug.cgi?id=12188

--- Comment #4 from Peter Alexander <peter.alexander.au@gmail.com> ---
(In reply to Andrei Alexandrescu from comment #3)
> It's easy to implement allBefore to return a new range type distinct (e.g.
> Voldemort) from R. That range would keep the two ranges as state and would
> say it's empty when whole.sameHead(right).

If I've understood you correctly, the range you describe can't be bidirectional, which is what we need here.

--
August 11, 2014
https://issues.dlang.org/show_bug.cgi?id=12188

--- Comment #5 from Andrei Alexandrescu <andrei@erdani.com> ---
Oh, yah, never mind.

--
September 12, 2014
https://issues.dlang.org/show_bug.cgi?id=12188

--- Comment #6 from hsteoh@quickfur.ath.cx ---
Well, I'm out of ideas. Seems the only way around this is to make nextPermutation require a random access range. :-(

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=12188

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3

--