Created on 2019-05-31.00:00:00, last changed 2019-07-23.15:26:26.
This wording is relative to N4810.
[Drafting note: Clause [algorithms] has not yet gone through a "Mandating" cleanup of our new wording style for requirements expressed in Requires and Expects elements. The below wording changes perform this fix for the touched paragraphs and also replaces here Requires by Expects to prevent papers that address such wording changes to keep tracking of additional wording changes caused by proposed wording of issues.]
Modify [alg.foreach] as indicated:
template<class InputIterator, class Size, class Function> constexpr InputIterator for_each_n(InputIterator first, Size n, Function f);
-16- Requires: shall satisfy the Cpp17MoveConstructible requirements […]-17-
Requires: n >= 0. […]template<class ExecutionPolicy, class ForwardIterator, class Size, class Function> ForwardIterator for_each_n(ExecutionPolicy&& exec, ForwardIterator first, Size n, Function f);
-21- Requires: shall satisfy the Cpp17CopyConstructible requirements […]-22-
Requires: n >= 0. […]
Modify [alg.copy] as indicated:
template<class InputIterator, class Size, class OutputIterator> constexpr OutputIterator copy_n(InputIterator first, Size n, OutputIterator result); template<class ExecutionPolicy, class ForwardIterator1, class Size, class ForwardIterator2> ForwardIterator2 copy_n(ExecutionPolicy&& exec, ForwardIterator1 first, Size n, ForwardIterator2 result); template<InputIterator I, WeaklyIncrementable O> requires IndirectlyCopyable<I, O> constexpr ranges::copy_n_result<I, O> ranges::copy_n(I first, iter_difference_t<I> n, O result);
-10- Let M be max(n, 0).[…]
[ 2019-07 Issue Prioritiztion ]
Priority to 3 after discussion on the reflector.
search_n and fill_n and generate_n require that "The type Size shall be convertible to integral type", but for_each_n and copy_n have no requirements on Size. Presumably it should be convertible to an integral type.
|2019-07-23 15:26:26||admin||set||messages: + msg10495|
|2019-06-08 17:20:04||admin||set||messages: + msg10426|