Simplified random_shuffle_permutation implementation
authorkhizmax <libcds.dev@gmail.com>
Tue, 12 May 2015 21:12:49 +0000 (00:12 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 12 May 2015 21:12:49 +0000 (00:12 +0300)
cds/opt/permutation.h

index 595522e6af355945cc6da5f2a51701a98c4eff3c..dbf138c7767b9113d74b71574143ef6b306b3b03 100644 (file)
@@ -205,14 +205,13 @@ namespace cds { namespace opt {
             integer_type *      m_pLast;
 
             random_generator    m_RandomGenerator;
-            random_device       m_RandomDevice;
             //@endcond
 
         public:
             /// Initializes the generator of arbitrary length \p nLength
             random_shuffle_permutation( size_t nLength )
                 : m_pCur( nullptr )
-                , m_RandomGenerator( m_RandomDevice() )
+                , m_RandomGenerator( random_device()() )
             {
                 m_pFirst = new integer_type[nLength];
                 m_pLast = m_pFirst + nLength;