This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
constexpr
specifierSection: 26.1 [algorithms.general] Status: C++17 Submitter: Jonathan Wakely Opened: 2016-06-21 Last modified: 2017-07-30
Priority: 0
View all issues with C++17 status.
Discussion:
In LEWG we noticed some parallel algorithms are constexpr
. Jared said:
std::max_element
/std::minmax_element
. To my knowledge,
neither SG1 nor LWG ever explicitly considered whether a parallel algorithm should be constexpr
. I think the assumption
was that parallel algorithms would be regular old function templates without additional specifiers such as constexpr
.
[2016-06 Oulu]
Moved to P0/Ready during issues prioritization.
Friday: status to Immediate
Proposed resolution:
This wording is relative to N4594.
Change the <algorithm>
header synopsis, 26.1 [algorithms.general], as indicated,
to remove "constexpr
" from the six {min,max,minmax}_element
overloads with an ExecutionPolicy
argument:
namespace std { […] // 25.5.7, minimum and maximum: […] template<class ExecutionPolicy, class ForwardIterator>constexprForwardIterator min_element(ExecutionPolicy&& exec, // see 25.2.5 ForwardIterator first, ForwardIterator last); template<class ExecutionPolicy, class ForwardIterator, class Compare>constexprForwardIterator min_element(ExecutionPolicy&& exec, // see 25.2.5 ForwardIterator first, ForwardIterator last, Compare comp); […] template<class ExecutionPolicy, class ForwardIterator>constexprForwardIterator max_element(ExecutionPolicy&& exec, // see 25.2.5 ForwardIterator first, ForwardIterator last); template<class ExecutionPolicy, class ForwardIterator, class Compare>constexprForwardIterator max_element(ExecutionPolicy&& exec, // see 25.2.5 ForwardIterator first, ForwardIterator last, Compare comp); […] template<class ExecutionPolicy, class ForwardIterator>constexprpair<ForwardIterator, ForwardIterator> minmax_element(ExecutionPolicy&& exec, // see 25.2.5 ForwardIterator first, ForwardIterator last); template<class ExecutionPolicy, class ForwardIterator, class Compare>constexprpair<ForwardIterator, ForwardIterator> minmax_element(ExecutionPolicy&& exec, // see 25.2.5 ForwardIterator first, ForwardIterator last, Compare comp); […] }