If you look at the characteristics of random shuffling in C ++ 11, there are 3 functions. My question is what are the typical uses and benefits:
template< class RandomIt, class URNG > void shuffle( RandomIt first, RandomIt last, URNG&& g );
compared with:
template< class RandomIt > void random_shuffle( RandomIt first, RandomIt last );
I mean, whatever the URNG (uniform distribution), the result will be the same (from a statistical point of view). The only thing I see is that std::shuffle is safe, while this overload of std::random_shuffle not. Could you confirm this?
EDIT: I thought URNG should be uniform distribution, but this does not seem to compile. So can anyone give a small example using std::shuffle ?
source share