Thread overview
[Issue 13594] std.algorithm.nextPermutation should accept ranges of lvalues
[Issue 13594] std.algorithm.nextPermutation for fixed size arrays too
October 30, 2014
https://issues.dlang.org/show_bug.cgi?id=13594

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--
October 30, 2014
https://issues.dlang.org/show_bug.cgi?id=13594

hsteoh@quickfur.ath.cx changed:

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

--- Comment #1 from hsteoh@quickfur.ath.cx ---
https://github.com/D-Programming-Language/phobos/pull/2650

--
October 30, 2014
https://issues.dlang.org/show_bug.cgi?id=13594

--- Comment #2 from bearophile_hugs@eml.cc ---
(In reply to hsteoh from comment #1)
> https://github.com/D-Programming-Language/phobos/pull/2650

This is an improvement. But it's a hack: it still throws away precious compile-time knowledge of the array length.

--
October 30, 2014
https://issues.dlang.org/show_bug.cgi?id=13594

--- Comment #3 from hsteoh@quickfur.ath.cx ---
The permutation algorithm needs to iterate over subarrays of varying lengths anyway, so losing the compile-time length of the overall array isn't that big of a deal.

--
October 31, 2014
https://issues.dlang.org/show_bug.cgi?id=13594

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com
            Summary|std.algorithm.nextPermutati |std.algorithm.nextPermutati
                   |on for fixed size arrays    |on should accept ranges of
                   |too                         |lvalues
           Severity|enhancement                 |normal

--- Comment #4 from Steven Schveighoffer <schveiguy@yahoo.com> ---
I'm changing the requirements. Bearophile's second attempt with the slice operator should compile. There is no need to require the range itself to be an lvalue, just that its elements are lvalues.

I also consider it a bug that this isn't the case.

--
November 02, 2014
https://issues.dlang.org/show_bug.cgi?id=13594

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/ef2e43181b7dbe7f98d9be1ee3e415f5dbbe49fb Fix issue 13594: next(Even)Permutation doesn't need to take input range by ref.

https://github.com/D-Programming-Language/phobos/commit/9add378a5c1626ca49ef77170466feb576505974 Merge pull request #2651 from quickfur/issue13594b

Fix issue 13594: next(Even)Permutation doesn't need to take input range by ref.

--
November 02, 2014
https://issues.dlang.org/show_bug.cgi?id=13594

github-bugzilla@puremagic.com changed:

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

--
February 18, 2015
https://issues.dlang.org/show_bug.cgi?id=13594

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to 2.067 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/ef2e43181b7dbe7f98d9be1ee3e415f5dbbe49fb Fix issue 13594: next(Even)Permutation doesn't need to take input range by ref.

https://github.com/D-Programming-Language/phobos/commit/9add378a5c1626ca49ef77170466feb576505974 Merge pull request #2651 from quickfur/issue13594b

--