|
9414 | 9414 | \end{itemdecl}
|
9415 | 9415 |
|
9416 | 9416 | \begin{itemdescr}
|
| 9417 | +\pnum |
| 9418 | +Let \tcode{T} be the value type of \tcode{decltype(first)}. |
| 9419 | +For the overloads that do not take an argument \tcode{binary_op}, |
| 9420 | +let \tcode{binary_op} be an lvalue |
| 9421 | +that denotes an object of type \tcode{minus<>}. |
| 9422 | + |
9417 | 9423 | \pnum
|
9418 | 9424 | \requires
|
9419 | 9425 | \begin{itemize}
|
9420 | 9426 | \item
|
9421 |
| -For the overloads with no \tcode{ExecutionPolicy}, \tcode{InputIterator}'s value |
9422 |
| -type shall be \tcode{MoveAssignable} (\tref{moveassignable}) and shall |
| 9427 | +For the overloads with no \tcode{ExecutionPolicy}, |
| 9428 | +\tcode{T} shall be \tcode{MoveAssignable} (\tref{moveassignable}) and shall |
9423 | 9429 | be constructible from the type of \tcode{*first}. \tcode{acc} (defined below)
|
9424 | 9430 | shall be writable\iref{iterator.requirements.general} to the \tcode{result}
|
9425 |
| -output iterator. The result of the expression \tcode{val - std::move(acc)} or |
| 9431 | +output iterator. The result of the expression |
9426 | 9432 | \tcode{binary_op(val, std::move(acc))} shall be writable to the \tcode{result} output iterator.
|
9427 | 9433 |
|
9428 | 9434 | \item
|
9429 |
| -For the overloads with an \tcode{ExecutionPolicy}, the value type of |
9430 |
| -\tcode{ForwardIterator1} |
9431 |
| -shall be \tcode{CopyConstructible} (\tref{copyconstructible}), |
9432 |
| -constructible from the expression \tcode{*first - *first} or |
9433 |
| -\tcode{binary_op(*first, *first)}, and assignable to the value type of |
9434 |
| -\tcode{ForwardIterator2}. |
| 9435 | +For the overloads with an \tcode{ExecutionPolicy}, |
| 9436 | +the result of the expressions \tcode{binary_op(*first, *first)} and |
| 9437 | +\tcode{*first} shall be writable to \tcode{result}. |
9435 | 9438 |
|
9436 | 9439 | \item
|
9437 | 9440 | For all overloads, in the ranges
|
|
9445 | 9448 |
|
9446 | 9449 | \pnum
|
9447 | 9450 | \effects For the overloads with no \tcode{ExecutionPolicy} and a non-empty range,
|
9448 |
| -the function creates an accumulator \tcode{acc} whose type is \tcode{InputIterator}'s |
9449 |
| -value type, initializes it with \tcode{*first}, |
| 9451 | +the function creates an accumulator \tcode{acc} of type \tcode{T}, |
| 9452 | +initializes it with \tcode{*first}, |
9450 | 9453 | and assigns the result to \tcode{*result}. For every iterator \tcode{i} in \range{first + 1}{last}
|
9451 |
| -in order, creates an object \tcode{val} whose type is \tcode{InputIterator}'s value type, initializes it |
9452 |
| -with \tcode{*i}, computes \tcode{val - std::move(acc)} or \tcode{binary_op(val, std::move(acc))}, assigns the result |
| 9454 | +in order, creates an object \tcode{val} whose type is \tcode{T}, initializes it |
| 9455 | +with \tcode{*i}, computes \tcode{binary_op(val, std::move(acc))}, assigns the result |
9453 | 9456 | to \tcode{*(result + (i - first))}, and move assigns from \tcode{val} to \tcode{acc}.
|
9454 | 9457 |
|
9455 | 9458 | \pnum
|
9456 |
| -For the overloads with an \tcode{ExecutionPolicy} and a non-empty range, first the |
9457 |
| -function creates an object whose type is \tcode{ForwardIterator1}'s value type, |
9458 |
| -initializes it with \tcode{*first}, and assigns the result to \tcode{*result}. |
9459 |
| -Then for every \tcode{d} |
9460 |
| -in \crange{1}{last - first - 1}, creates an object \tcode{val} whose type is |
9461 |
| -\tcode{ForwardIterator1}'s value type, initializes it with |
9462 |
| -\tcode{*(first + d) - *(first + d - 1)} or |
9463 |
| -\tcode{binary_op(*(first + d), *(first + d - 1))}, and assigns the result to |
9464 |
| -\tcode{*(result + d)}. |
| 9459 | +For the overloads with an \tcode{ExecutionPolicy} and a non-empty range, |
| 9460 | +performs \tcode{*result = *first}. |
| 9461 | +Then, for every \tcode{d} in \tcode{[1, last - first - 1]}, |
| 9462 | +performs \tcode{*(result + d) = binary_op(*(first + d), *(first + (d - 1)))}. |
9465 | 9463 |
|
9466 | 9464 | \pnum
|
9467 | 9465 | \returns
|
|
0 commit comments