Skip to content

Commit

Permalink
Replace random_shuffle with shuffle as it's removed from C++17 (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar authored Aug 11, 2024
1 parent 2d6b238 commit 6a4faf9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/tcframe/spec/random/Random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <random>

using std::mt19937;
using std::random_shuffle;
using std::uniform_real_distribution;
using std::uniform_int_distribution;

Expand Down Expand Up @@ -45,7 +44,7 @@ class Random {

template<typename RandomAccessIterator>
void shuffle(RandomAccessIterator first, RandomAccessIterator last) {
random_shuffle(first, last, [this](unsigned int idx) { return nextInt(idx); });
std::shuffle(first, last, engine);
}

private:
Expand Down

0 comments on commit 6a4faf9

Please sign in to comment.