Do not use ADL to invoke std algos (#14851)

This is a follow up for #14716
This commit is contained in:
Yuriy Chernyshov 2023-03-03 03:38:33 +04:00 committed by GitHub
parent 70a31e047a
commit 0ebe8e34f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,7 @@ static void SelectTopK(const Comparator& comparer,
// find the top k (largest or smallest) elements in the data holder - O(n) average. O(n*n) worst case.
// See https://en.wikipedia.org/wiki/Quickselect
nth_element(data_holder.begin(), data_holder.begin() + (k - 1), data_holder.end(), comparer);
std::nth_element(data_holder.begin(), data_holder.begin() + (k - 1), data_holder.end(), comparer);
// sort the top k elements if needed - O (k log k)
if (sort_top_k) {