[libcxx-commits] [libcxx] [libc++][pstl] Implement pstl std::min_element (PR #173970)
Marcell Leleszi via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 5 07:48:28 PST 2026
mleleszi wrote:
@philnik777 I initially wanted to do it that way, but std::min_element needs to return the iterator to the first min value, not the value itself, and the transform_reduce interface in the default backend operates on values (both the transform and the reduce functions receive dereferenced elements, not the iterators) and also returns the value, not an iterator. If we wanted to make it work with that, we'd need to iterate over the indices rather than the elements directly, but for that we'd need a counting iterator. Do we have something like std::views::iota for c++17 internally, or we'd need to implement that?
Do you think this makes it OK for min_element to have its own backend implementation, or am I missing something?
https://github.com/llvm/llvm-project/pull/173970
More information about the libcxx-commits
mailing list