Thread overview
[Issue 14001] Optionally @nogc std.random.randomCover
Aug 10, 2018
Nathan S.
January 18, 2015
https://issues.dlang.org/show_bug.cgi?id=14001

--- Comment #1 from bearophile_hugs@eml.cc ---
In many use cases you don't need allocations, if you reserve a size_t inside the RandomCover struct, and you use such size_t as a bit array, you can manage the cases where the input 'r' is up to 32 or 64 items long without need of any array buf.

--
August 10, 2018
https://issues.dlang.org/show_bug.cgi?id=14001

Nathan S. <n8sh.secondary@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |n8sh.secondary@hotmail.com

--- Comment #2 from Nathan S. <n8sh.secondary@hotmail.com> ---
Partial work done in accepted PR https://github.com/dlang/phobos/pull/6576 Remaining work done in open PR https://github.com/dlang/phobos/pull/6657

--
August 14, 2018
https://issues.dlang.org/show_bug.cgi?id=14001

--- Comment #3 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/3a212c0c72b7177a51dde9d4bbb5bbb5a9254a35
Fix Issue 14001 - Optionally `@nogc` std.random.randomCover
Fix Issue 19156 - `@nogc` std.random.randomShuffle

Solution is to use a private `_randomIndex` function that is guaranteed to be called only with valid bounds.

https://github.com/dlang/phobos/commit/91c9973d72a7f1ad3d958f226508520d257f9ce7 Merge pull request #6657 from n8sh/std-random-14001-19156

Fix Issue 14001 & Issue 19156 - `@nogc` std.random.randomCover and std.random.randomShuffle

--
August 14, 2018
https://issues.dlang.org/show_bug.cgi?id=14001

github-bugzilla@puremagic.com changed:

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

--