Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuiba committed Apr 20, 2024
1 parent bfd170f commit fb8cf2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions common/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ limitations under the License.
#include <type_traits>
#include <assert.h>
#include <utility>
#include <random>
#include <algorithm>
#include "string_view.h"
// #include <string>

Expand Down Expand Up @@ -202,13 +200,6 @@ xrange_t<uint64_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);
Expand Down
9 changes: 9 additions & 0 deletions test/gtest.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#include <random>
#include <algorithm>

// #pragma GCC diagnostic push
// #ifdef __clang__
Expand All @@ -10,3 +12,10 @@
#include <gtest/gtest-spi.h>
// #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);
}

0 comments on commit fb8cf2f

Please sign in to comment.