Merge branch 'main' of www.swiftcoder.nl:git/experimental/cpp/libscnumerics

This commit is contained in:
Bob Polis 2021-11-13 19:15:13 +01:00
commit 94043b3aac

View File

@ -27,7 +27,7 @@ namespace sc {
template <typename T>
static T choice(const std::vector<T>& vec) {
std::uniform_int_distribution<int> dist {0, vec.size() - 1};
std::uniform_int_distribution<int> dist {0, static_cast<int>(vec.size()) - 1};
return vec[dist(instance()._reng)];
}