diff options
author | Andrew Morrow <acm@mongodb.com> | 2018-05-23 12:54:08 -0400 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2018-05-23 16:11:39 -0400 |
commit | 56ec2fc78cb0d2d6e3850b2df06eb0d5b4f487f4 (patch) | |
tree | d30e29e829b755f755ce8047b9c08e35c39bd312 /src/mongo/db/sorter | |
parent | 908df56a8ef1f5f599bf4797dfee7838e326a2ee (diff) | |
download | mongo-56ec2fc78cb0d2d6e3850b2df06eb0d5b4f487f4.tar.gz |
SERVER-35170 Add misc fixes to enable building in -std=c++17 mode
Diffstat (limited to 'src/mongo/db/sorter')
-rw-r--r-- | src/mongo/db/sorter/sorter_test.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/sorter/sorter_test.cpp b/src/mongo/db/sorter/sorter_test.cpp index 3ba4e8a98c3..6fb550b24cd 100644 --- a/src/mongo/db/sorter/sorter_test.cpp +++ b/src/mongo/db/sorter/sorter_test.cpp @@ -39,6 +39,7 @@ #include "mongo/db/service_context.h" #include "mongo/db/service_context_noop.h" #include "mongo/db/service_context_registrar.h" +#include "mongo/platform/random.h" #include "mongo/stdx/thread.h" #include "mongo/unittest/temp_dir.h" #include "mongo/unittest/unittest.h" @@ -477,12 +478,12 @@ class Dupes : public Basic { template <bool Random = true> class LotsOfDataLittleMemory : public Basic { public: - LotsOfDataLittleMemory() : _array(new int[NUM_ITEMS]) { + LotsOfDataLittleMemory() : _array(new int[NUM_ITEMS]), _random(int64_t(time(0))) { for (int i = 0; i < NUM_ITEMS; i++) _array[i] = i; if (Random) - std::random_shuffle(_array.get(), _array.get() + NUM_ITEMS); + std::shuffle(_array.get(), _array.get() + NUM_ITEMS, _random.urbg()); } SortOptions adjustSortOptions(SortOptions opts) { @@ -516,6 +517,7 @@ public: MEM_LIMIT = 64 * 1024, }; std::unique_ptr<int[]> _array; + PseudoRandom _random; }; |