7 Nov
2016
7 Nov
'16
12:45 p.m.
On 11/07/16 15:28, Peter Dimov wrote:
Andrey Semashev wrote:
FWIW, in Boost.Log I'm using my local random_shuffle[1] regardless of the standard library version. Maybe that would be a better solution than conditioning your code on config macros.
[1]: https://github.com/boostorg/log/blob/develop/src/core.cpp#L60
The standard random_shuffle doesn't use rng() % n though, it uses rng(n). rng() % n is non-uniform in general.
True, a more generic implementation would use uniform_int_distribution. It's fine for my particular use though, and maybe it would be fine for someone else's case, too.