Skip to content

Commit

Permalink
density sketch c++17 compatibility
Browse files Browse the repository at this point in the history
std::random_shuffle() is removed in c++17 so this ensures strict compatibility with the standard by using a c++11-compatible method to achieve the same goal.
  • Loading branch information
jmalkin committed Jan 4, 2024
1 parent 7934d4c commit a7697f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion density/include/density_sketch_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void density_sketch<T, K, A>::compact_level(unsigned height) {
auto& level = levels_[height];
std::vector<bool> bits(level.size());
bits[0] = random_utils::random_bit();
std::random_shuffle(level.begin(), level.end());
std::shuffle(level.begin(), level.end(), random_utils::rand);
for (unsigned i = 1; i < level.size(); ++i) {
T delta = 0;
for (unsigned j = 0; j < i; ++j) {
Expand Down

0 comments on commit a7697f4

Please sign in to comment.