Stop using deprecated std::random_shuffle
Newer C++ standards remove it, and newer clang gets grumpy. Remove it.
Change-Id: I6d1d354bf1e1f36d732942a9ba6ab22fabf529fa
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2020/actors/shooter_tuning_actor.cc b/y2020/actors/shooter_tuning_actor.cc
index a6c8d88..d18c518 100644
--- a/y2020/actors/shooter_tuning_actor.cc
+++ b/y2020/actors/shooter_tuning_actor.cc
@@ -2,6 +2,7 @@
#include <cstdlib>
#include <ctime>
#include <fstream>
+#include <random>
#include <sstream>
#include <utility>
@@ -91,7 +92,9 @@
}
// Randomize the ordering of the velocities
std::srand(std::time(nullptr));
- std::random_shuffle(velocities_.begin(), velocities_.end());
+ std::random_device random_device;
+ std::mt19937 generator(random_device());
+ std::shuffle(velocities_.begin(), velocities_.end(), generator);
}
bool ShooterTuningActor::RunAction(