Created on 2013-12-15.00:00:00 last changed 131 months ago
Proposed resolution:
This wording is relative to N3797.
In [algorithms.general], header <algorithm> synopsis, and [alg.min.max], change as indicated (add constexpr to every signature before min_element):
template<class T> constexpr const T& min(const T& a, const T& b); template<class T, class Compare> constexpr const T& min(const T& a, const T& b, Compare comp); […] template<class T> constexpr T min(initializer_list<T> t); template<class T, class Compare> constexpr T min(initializer_list<T> t, Compare comp); […] template<class T> constexpr const T& max(const T& a, const T& b); template<class T, class Compare> constexpr const T& max(const T& a, const T& b, Compare comp); […] template<class T> constexpr T max(initializer_list<T> t); template<class T, class Compare> constexpr T max(initializer_list<T> t, Compare comp); […] template<class T> constexpr pair<const T&, const T&> minmax(const T& a, const T& b); template<class T, class Compare> constexpr pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp); […] template<class T> constexpr pair<T, T> minmax(initializer_list<T> t); template<class T, class Compare> constexpr pair<T, T> minmax(initializer_list<T> t, Compare comp);
Having min, max, and minmax constexpr was a large part of the motivation to allow reference-to-const arguments for constexpr functions as per N3039. Furthermore, initializer_lists are immutable and not-movable-from for large part in order to allow using them in constexpr contexts and other hoisting-optimizations. In N3797 version of the draft none of these functions are constexpr, and they should be made constexpr.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-27 17:03:20 | admin | set | status: wp -> c++14 |
2014-02-20 13:52:38 | admin | set | status: immediate -> wp |
2014-02-12 23:34:43 | admin | set | status: new -> immediate |
2014-02-11 06:32:08 | admin | set | messages: + msg6815 |
2013-12-15 00:00:00 | admin | create |