Skip to content

Commit

Permalink
Use std::shuffle instead of std::random_shuffle
Browse files Browse the repository at this point in the history
As std::random_shuffle was removed in C++17
  • Loading branch information
traversaro authored Dec 4, 2023
1 parent a734b12 commit 65a1322
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/model_io/codecs/tests/URDFModelImportUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ void checkLoadReducedModelOrderIsKept(std::string urdfFileName)
}
}

std::random_shuffle(dofsName.begin(), dofsName.end());
std::random_device rd;
std::mt19937 random_gen(rd());
std::shuffle(dofsName.begin(), dofsName.end(), random_gen);

//now load the new model and check they are the same
ASSERT_IS_TRUE(loader.loadReducedModelFromFullModel(loadedModel, dofsName) && loader.isValid());
Expand Down

0 comments on commit 65a1322

Please sign in to comment.