std::max_element_if, std::min_element_if

129 views
Skip to first unread message

Vlad from Moscow

unread,
May 30, 2018, 10:52:18 AM5/30/18
to ISO C++ Standard - Future Proposals
In my opinion apart from the standard algorithms std::max_element and std::min_element there are required algorithms like std::max_element_if and std::min_element_if that accept a predicate that selects elements of a sequence for which the maximum element and minimum element are searched.


Nicol Bolas

unread,
May 30, 2018, 11:26:09 AM5/30/18
to ISO C++ Standard - Future Proposals
On Wednesday, May 30, 2018 at 10:52:18 AM UTC-4, Vlad from Moscow wrote:
In my opinion apart from the standard algorithms std::max_element and std::min_element there are required algorithms like std::max_element_if and std::min_element_if that accept a predicate that selects elements of a sequence for which the maximum element and minimum element are searched.

This is what range filters are for. We shouldn't have `_if` versions of algorithms; you should apply a filter to the range.
Reply all
Reply to author
Forward
0 new messages