[libcxx-commits] [PATCH] D122002: [libc++][ranges] Implement ranges::max
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 20 09:08:52 PDT 2022
ldionne added inline comments.
================
Comment at: libcxx/include/__algorithm/ranges_max_element.h:39
+ auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
+ return __min_element_impl(__first, __last, __comp_lhs_rhs_swapped, __proj);
}
----------------
I just stumbled upon this, but this is not ADL-safe. Can you please fix and add a test? It is probably worth checking in other algorithms too if there is the same problem, while we're at it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122002/new/
https://reviews.llvm.org/D122002
More information about the libcxx-commits
mailing list