diff --git a/common/utility.h b/common/utility.h index 52a7ddbd..3ca8af0a 100644 --- a/common/utility.h +++ b/common/utility.h @@ -20,8 +20,6 @@ limitations under the License. #include #include #include -#include -#include #include "string_view.h" // #include @@ -202,13 +200,6 @@ xrange_t xrange(T end) #define FOR_LOOP(N) for (auto i = N; i; --i) -template< class RandomIt> inline -void shuffle( RandomIt first, RandomIt last) { - std::random_device rd; - std::mt19937 g(rd()); - return std::shuffle(first, last, g); -} - inline uint64_t align_down(uint64_t x, uint64_t alignment) { return x & ~(alignment - 1); diff --git a/test/gtest.h b/test/gtest.h index 0a7900d8..a562f174 100644 --- a/test/gtest.h +++ b/test/gtest.h @@ -1,4 +1,6 @@ #pragma once +#include +#include // #pragma GCC diagnostic push // #ifdef __clang__ @@ -10,3 +12,10 @@ #include // #pragma GCC diagnostic pop +template< class RandomIt> inline +void shuffle( RandomIt first, RandomIt last) { + std::random_device rd; + std::mt19937 g(rd()); + return std::shuffle(first, last, g); +} +