|
8552 | 8552 | namespace std {
|
8553 | 8553 | // \ref{accumulate}, accumulate
|
8554 | 8554 | template<class InputIterator, class T>
|
8555 |
| - T accumulate(InputIterator first, InputIterator last, T init); |
| 8555 | + constexpr T accumulate(InputIterator first, InputIterator last, T init); |
8556 | 8556 | template<class InputIterator, class T, class BinaryOperation>
|
8557 |
| - T accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); |
| 8557 | + constexpr T accumulate(InputIterator first, InputIterator last, T init, |
| 8558 | + BinaryOperation binary_op); |
8558 | 8559 |
|
8559 | 8560 | // \ref{reduce}, reduce
|
8560 | 8561 | template<class InputIterator>
|
8561 |
| - typename iterator_traits<InputIterator>::value_type |
| 8562 | + constexpr typename iterator_traits<InputIterator>::value_type |
8562 | 8563 | reduce(InputIterator first, InputIterator last);
|
8563 | 8564 | template<class InputIterator, class T>
|
8564 |
| - T reduce(InputIterator first, InputIterator last, T init); |
| 8565 | + constexpr T reduce(InputIterator first, InputIterator last, T init); |
8565 | 8566 | template<class InputIterator, class T, class BinaryOperation>
|
8566 |
| - T reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); |
| 8567 | + constexpr T reduce(InputIterator first, InputIterator last, T init, |
| 8568 | + BinaryOperation binary_op); |
8567 | 8569 | template<class ExecutionPolicy, class ForwardIterator>
|
8568 | 8570 | typename iterator_traits<ForwardIterator>::value_type
|
8569 | 8571 | reduce(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
|
|
8577 | 8579 |
|
8578 | 8580 | // \ref{inner.product}, inner product
|
8579 | 8581 | template<class InputIterator1, class InputIterator2, class T>
|
8580 |
| - T inner_product(InputIterator1 first1, InputIterator1 last1, |
8581 |
| - InputIterator2 first2, T init); |
| 8582 | + constexpr T inner_product(InputIterator1 first1, InputIterator1 last1, |
| 8583 | + InputIterator2 first2, T init); |
8582 | 8584 | template<class InputIterator1, class InputIterator2, class T,
|
8583 | 8585 | class BinaryOperation1, class BinaryOperation2>
|
8584 |
| - T inner_product(InputIterator1 first1, InputIterator1 last1, |
8585 |
| - InputIterator2 first2, T init, |
8586 |
| - BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); |
| 8586 | + constexpr T inner_product(InputIterator1 first1, InputIterator1 last1, |
| 8587 | + InputIterator2 first2, T init, |
| 8588 | + BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); |
8587 | 8589 |
|
8588 | 8590 | // \ref{transform.reduce}, transform reduce
|
8589 | 8591 | template<class InputIterator1, class InputIterator2, class T>
|
8590 |
| - T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
8591 |
| - InputIterator2 first2, T init); |
| 8592 | + constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
| 8593 | + InputIterator2 first2, T init); |
8592 | 8594 | template<class InputIterator1, class InputIterator2, class T,
|
8593 | 8595 | class BinaryOperation1, class BinaryOperation2>
|
8594 |
| - T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
8595 |
| - InputIterator2 first2, T init, |
8596 |
| - BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); |
| 8596 | + constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
| 8597 | + InputIterator2 first2, T init, |
| 8598 | + BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); |
8597 | 8599 | template<class InputIterator, class T,
|
8598 | 8600 | class BinaryOperation, class UnaryOperation>
|
8599 |
| - T transform_reduce(InputIterator first, InputIterator last, T init, |
8600 |
| - BinaryOperation binary_op, UnaryOperation unary_op); |
| 8601 | + constexpr T transform_reduce(InputIterator first, InputIterator last, T init, |
| 8602 | + BinaryOperation binary_op, UnaryOperation unary_op); |
8601 | 8603 | template<class ExecutionPolicy,
|
8602 | 8604 | class ForwardIterator1, class ForwardIterator2, class T>
|
8603 | 8605 | T transform_reduce(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads}
|
|
8618 | 8620 |
|
8619 | 8621 | // \ref{partial.sum}, partial sum
|
8620 | 8622 | template<class InputIterator, class OutputIterator>
|
8621 |
| - OutputIterator |
| 8623 | + constexpr OutputIterator |
8622 | 8624 | partial_sum(InputIterator first, InputIterator last,
|
8623 | 8625 | OutputIterator result);
|
8624 | 8626 | template<class InputIterator, class OutputIterator, class BinaryOperation>
|
8625 |
| - OutputIterator |
| 8627 | + constexpr OutputIterator |
8626 | 8628 | partial_sum(InputIterator first, InputIterator last,
|
8627 | 8629 | OutputIterator result, BinaryOperation binary_op);
|
8628 | 8630 |
|
8629 | 8631 | // \ref{exclusive.scan}, exclusive scan
|
8630 | 8632 | template<class InputIterator, class OutputIterator, class T>
|
8631 |
| - OutputIterator |
| 8633 | + constexpr OutputIterator |
8632 | 8634 | exclusive_scan(InputIterator first, InputIterator last,
|
8633 | 8635 | OutputIterator result, T init);
|
8634 | 8636 | template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
|
8635 |
| - OutputIterator |
| 8637 | + constexpr OutputIterator |
8636 | 8638 | exclusive_scan(InputIterator first, InputIterator last,
|
8637 | 8639 | OutputIterator result, T init, BinaryOperation binary_op);
|
8638 | 8640 | template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
|
|
8649 | 8651 |
|
8650 | 8652 | // \ref{inclusive.scan}, inclusive scan
|
8651 | 8653 | template<class InputIterator, class OutputIterator>
|
8652 |
| - OutputIterator |
| 8654 | + constexpr OutputIterator |
8653 | 8655 | inclusive_scan(InputIterator first, InputIterator last,
|
8654 | 8656 | OutputIterator result);
|
8655 | 8657 | template<class InputIterator, class OutputIterator, class BinaryOperation>
|
8656 |
| - OutputIterator |
| 8658 | + constexpr OutputIterator |
8657 | 8659 | inclusive_scan(InputIterator first, InputIterator last,
|
8658 | 8660 | OutputIterator result, BinaryOperation binary_op);
|
8659 | 8661 | template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
|
8660 |
| - OutputIterator |
| 8662 | + constexpr OutputIterator |
8661 | 8663 | inclusive_scan(InputIterator first, InputIterator last,
|
8662 | 8664 | OutputIterator result, BinaryOperation binary_op, T init);
|
8663 | 8665 | template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
|
|
8681 | 8683 | // \ref{transform.exclusive.scan}, transform exclusive scan
|
8682 | 8684 | template<class InputIterator, class OutputIterator, class T,
|
8683 | 8685 | class BinaryOperation, class UnaryOperation>
|
8684 |
| - OutputIterator |
| 8686 | + constexpr OutputIterator |
8685 | 8687 | transform_exclusive_scan(InputIterator first, InputIterator last,
|
8686 | 8688 | OutputIterator result, T init,
|
8687 | 8689 | BinaryOperation binary_op, UnaryOperation unary_op);
|
|
8696 | 8698 | // \ref{transform.inclusive.scan}, transform inclusive scan
|
8697 | 8699 | template<class InputIterator, class OutputIterator,
|
8698 | 8700 | class BinaryOperation, class UnaryOperation>
|
8699 |
| - OutputIterator |
| 8701 | + constexpr OutputIterator |
8700 | 8702 | transform_inclusive_scan(InputIterator first, InputIterator last,
|
8701 | 8703 | OutputIterator result,
|
8702 | 8704 | BinaryOperation binary_op, UnaryOperation unary_op);
|
8703 | 8705 | template<class InputIterator, class OutputIterator,
|
8704 | 8706 | class BinaryOperation, class UnaryOperation, class T>
|
8705 |
| - OutputIterator |
| 8707 | + constexpr OutputIterator |
8706 | 8708 | transform_inclusive_scan(InputIterator first, InputIterator last,
|
8707 | 8709 | OutputIterator result,
|
8708 | 8710 | BinaryOperation binary_op, UnaryOperation unary_op, T init);
|
|
8723 | 8725 |
|
8724 | 8726 | // \ref{adjacent.difference}, adjacent difference
|
8725 | 8727 | template<class InputIterator, class OutputIterator>
|
8726 |
| - OutputIterator |
| 8728 | + constexpr OutputIterator |
8727 | 8729 | adjacent_difference(InputIterator first, InputIterator last,
|
8728 | 8730 | OutputIterator result);
|
8729 | 8731 | template<class InputIterator, class OutputIterator, class BinaryOperation>
|
8730 |
| - OutputIterator |
| 8732 | + constexpr OutputIterator |
8731 | 8733 | adjacent_difference(InputIterator first, InputIterator last,
|
8732 | 8734 | OutputIterator result, BinaryOperation binary_op);
|
8733 | 8735 | template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
|
|
8744 | 8746 |
|
8745 | 8747 | // \ref{numeric.iota}, iota
|
8746 | 8748 | template<class ForwardIterator, class T>
|
8747 |
| - void iota(ForwardIterator first, ForwardIterator last, T value); |
| 8749 | + constexpr void iota(ForwardIterator first, ForwardIterator last, T value); |
8748 | 8750 |
|
8749 | 8751 | // \ref{numeric.ops.gcd}, greatest common divisor
|
8750 | 8752 | template<class M, class N>
|
|
8798 | 8800 | \indexlibraryglobal{accumulate}%
|
8799 | 8801 | \begin{itemdecl}
|
8800 | 8802 | template<class InputIterator, class T>
|
8801 |
| - T accumulate(InputIterator first, InputIterator last, T init); |
| 8803 | + constexpr T accumulate(InputIterator first, InputIterator last, T init); |
8802 | 8804 | template<class InputIterator, class T, class BinaryOperation>
|
8803 |
| - T accumulate(InputIterator first, InputIterator last, T init, |
8804 |
| - BinaryOperation binary_op); |
| 8805 | + constexpr T accumulate(InputIterator first, InputIterator last, T init, |
| 8806 | + BinaryOperation binary_op); |
8805 | 8807 | \end{itemdecl}
|
8806 | 8808 |
|
8807 | 8809 | \begin{itemdescr}
|
|
8834 | 8836 | \indexlibraryglobal{reduce}%
|
8835 | 8837 | \begin{itemdecl}
|
8836 | 8838 | template<class InputIterator>
|
8837 |
| - typename iterator_traits<InputIterator>::value_type |
| 8839 | + constexpr typename iterator_traits<InputIterator>::value_type |
8838 | 8840 | reduce(InputIterator first, InputIterator last);
|
8839 | 8841 | \end{itemdecl}
|
8840 | 8842 |
|
|
8870 | 8872 | \indexlibraryglobal{reduce}%
|
8871 | 8873 | \begin{itemdecl}
|
8872 | 8874 | template<class InputIterator, class T>
|
8873 |
| - T reduce(InputIterator first, InputIterator last, T init); |
| 8875 | + constexpr T reduce(InputIterator first, InputIterator last, T init); |
8874 | 8876 | \end{itemdecl}
|
8875 | 8877 |
|
8876 | 8878 | \begin{itemdescr}
|
|
8902 | 8904 | \indexlibraryglobal{reduce}%
|
8903 | 8905 | \begin{itemdecl}
|
8904 | 8906 | template<class InputIterator, class T, class BinaryOperation>
|
8905 |
| - T reduce(InputIterator first, InputIterator last, T init, |
8906 |
| - BinaryOperation binary_op); |
| 8907 | + constexpr T reduce(InputIterator first, InputIterator last, T init, |
| 8908 | + BinaryOperation binary_op); |
8907 | 8909 | template<class ExecutionPolicy, class ForwardIterator, class T, class BinaryOperation>
|
8908 | 8910 | T reduce(ExecutionPolicy&& exec,
|
8909 | 8911 | ForwardIterator first, ForwardIterator last, T init,
|
|
8949 | 8951 | \indexlibraryglobal{inner_product}%
|
8950 | 8952 | \begin{itemdecl}
|
8951 | 8953 | template<class InputIterator1, class InputIterator2, class T>
|
8952 |
| - T inner_product(InputIterator1 first1, InputIterator1 last1, |
8953 |
| - InputIterator2 first2, T init); |
| 8954 | + constexpr T inner_product(InputIterator1 first1, InputIterator1 last1, |
| 8955 | + InputIterator2 first2, T init); |
8954 | 8956 | template<class InputIterator1, class InputIterator2, class T,
|
8955 | 8957 | class BinaryOperation1, class BinaryOperation2>
|
8956 |
| - T inner_product(InputIterator1 first1, InputIterator1 last1, |
8957 |
| - InputIterator2 first2, T init, |
8958 |
| - BinaryOperation1 binary_op1, |
8959 |
| - BinaryOperation2 binary_op2); |
| 8958 | + constexpr T inner_product(InputIterator1 first1, InputIterator1 last1, |
| 8959 | + InputIterator2 first2, T init, |
| 8960 | + BinaryOperation1 binary_op1, |
| 8961 | + BinaryOperation2 binary_op2); |
8960 | 8962 | \end{itemdecl}
|
8961 | 8963 |
|
8962 | 8964 | \begin{itemdescr}
|
|
8987 | 8989 | \indexlibraryglobal{transform_reduce}%
|
8988 | 8990 | \begin{itemdecl}
|
8989 | 8991 | template<class InputIterator1, class InputIterator2, class T>
|
8990 |
| - T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
8991 |
| - InputIterator2 first2, |
8992 |
| - T init); |
| 8992 | + constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
| 8993 | + InputIterator2 first2, |
| 8994 | + T init); |
8993 | 8995 | \end{itemdecl}
|
8994 | 8996 |
|
8995 | 8997 | \begin{itemdescr}
|
|
9025 | 9027 | \begin{itemdecl}
|
9026 | 9028 | template<class InputIterator1, class InputIterator2, class T,
|
9027 | 9029 | class BinaryOperation1, class BinaryOperation2>
|
9028 |
| - T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
9029 |
| - InputIterator2 first2, |
9030 |
| - T init, |
9031 |
| - BinaryOperation1 binary_op1, |
9032 |
| - BinaryOperation2 binary_op2); |
| 9030 | + constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1, |
| 9031 | + InputIterator2 first2, |
| 9032 | + T init, |
| 9033 | + BinaryOperation1 binary_op1, |
| 9034 | + BinaryOperation2 binary_op2); |
9033 | 9035 | template<class ExecutionPolicy,
|
9034 | 9036 | class ForwardIterator1, class ForwardIterator2, class T,
|
9035 | 9037 | class BinaryOperation1, class BinaryOperation2>
|
|
9079 | 9081 | \begin{itemdecl}
|
9080 | 9082 | template<class InputIterator, class T,
|
9081 | 9083 | class BinaryOperation, class UnaryOperation>
|
9082 |
| - T transform_reduce(InputIterator first, InputIterator last, T init, |
9083 |
| - BinaryOperation binary_op, UnaryOperation unary_op); |
| 9084 | + constexpr T transform_reduce(InputIterator first, InputIterator last, T init, |
| 9085 | + BinaryOperation binary_op, UnaryOperation unary_op); |
9084 | 9086 | template<class ExecutionPolicy,
|
9085 | 9087 | class ForwardIterator, class T,
|
9086 | 9088 | class BinaryOperation, class UnaryOperation>
|
|
9132 | 9134 | \indexlibraryglobal{partial_sum}%
|
9133 | 9135 | \begin{itemdecl}
|
9134 | 9136 | template<class InputIterator, class OutputIterator>
|
9135 |
| - OutputIterator |
| 9137 | + constexpr OutputIterator |
9136 | 9138 | partial_sum(InputIterator first, InputIterator last,
|
9137 | 9139 | OutputIterator result);
|
9138 | 9140 | template<class InputIterator, class OutputIterator, class BinaryOperation>
|
9139 |
| - OutputIterator |
| 9141 | + constexpr OutputIterator |
9140 | 9142 | partial_sum(InputIterator first, InputIterator last,
|
9141 | 9143 | OutputIterator result, BinaryOperation binary_op);
|
9142 | 9144 | \end{itemdecl}
|
|
9186 | 9188 | \indexlibraryglobal{exclusive_scan}%
|
9187 | 9189 | \begin{itemdecl}
|
9188 | 9190 | template<class InputIterator, class OutputIterator, class T>
|
9189 |
| - OutputIterator |
| 9191 | + constexpr OutputIterator |
9190 | 9192 | exclusive_scan(InputIterator first, InputIterator last,
|
9191 | 9193 | OutputIterator result, T init);
|
9192 | 9194 | \end{itemdecl}
|
|
9222 | 9224 | \indexlibraryglobal{exclusive_scan}%
|
9223 | 9225 | \begin{itemdecl}
|
9224 | 9226 | template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
|
9225 |
| - OutputIterator |
| 9227 | + constexpr OutputIterator |
9226 | 9228 | exclusive_scan(InputIterator first, InputIterator last,
|
9227 | 9229 | OutputIterator result, T init, BinaryOperation binary_op);
|
9228 | 9230 | template<class ExecutionPolicy,
|
|
9287 | 9289 | \indexlibraryglobal{inclusive_scan}%
|
9288 | 9290 | \begin{itemdecl}
|
9289 | 9291 | template<class InputIterator, class OutputIterator>
|
9290 |
| - OutputIterator |
| 9292 | + constexpr OutputIterator |
9291 | 9293 | inclusive_scan(InputIterator first, InputIterator last,
|
9292 | 9294 | OutputIterator result);
|
9293 | 9295 | \end{itemdecl}
|
|
9322 | 9324 | \indexlibraryglobal{inclusive_scan}%
|
9323 | 9325 | \begin{itemdecl}
|
9324 | 9326 | template<class InputIterator, class OutputIterator, class BinaryOperation>
|
9325 |
| - OutputIterator |
| 9327 | + constexpr OutputIterator |
9326 | 9328 | inclusive_scan(InputIterator first, InputIterator last,
|
9327 | 9329 | OutputIterator result, BinaryOperation binary_op);
|
9328 | 9330 | template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
|
9333 | 9335 | ForwardIterator2 result, BinaryOperation binary_op);
|
9334 | 9336 |
|
9335 | 9337 | template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
|
9336 |
| - OutputIterator |
| 9338 | + constexpr OutputIterator |
9337 | 9339 | inclusive_scan(InputIterator first, InputIterator last,
|
9338 | 9340 | OutputIterator result, BinaryOperation binary_op, T init);
|
9339 | 9341 | template<class ExecutionPolicy,
|
|
9411 | 9413 | \begin{itemdecl}
|
9412 | 9414 | template<class InputIterator, class OutputIterator, class T,
|
9413 | 9415 | class BinaryOperation, class UnaryOperation>
|
9414 |
| - OutputIterator |
| 9416 | + constexpr OutputIterator |
9415 | 9417 | transform_exclusive_scan(InputIterator first, InputIterator last,
|
9416 | 9418 | OutputIterator result, T init,
|
9417 | 9419 | BinaryOperation binary_op, UnaryOperation unary_op);
|
|
9486 | 9488 | \begin{itemdecl}
|
9487 | 9489 | template<class InputIterator, class OutputIterator,
|
9488 | 9490 | class BinaryOperation, class UnaryOperation>
|
9489 |
| - OutputIterator |
| 9491 | + constexpr OutputIterator |
9490 | 9492 | transform_inclusive_scan(InputIterator first, InputIterator last,
|
9491 | 9493 | OutputIterator result,
|
9492 | 9494 | BinaryOperation binary_op, UnaryOperation unary_op);
|
|
9500 | 9502 | BinaryOperation binary_op, UnaryOperation unary_op);
|
9501 | 9503 | template<class InputIterator, class OutputIterator,
|
9502 | 9504 | class BinaryOperation, class UnaryOperation, class T>
|
9503 |
| - OutputIterator |
| 9505 | + constexpr OutputIterator |
9504 | 9506 | transform_inclusive_scan(InputIterator first, InputIterator last,
|
9505 | 9507 | OutputIterator result,
|
9506 | 9508 | BinaryOperation binary_op, UnaryOperation unary_op,
|
|
9587 | 9589 | \indexlibraryglobal{adjacent_difference}%
|
9588 | 9590 | \begin{itemdecl}
|
9589 | 9591 | template<class InputIterator, class OutputIterator>
|
9590 |
| - OutputIterator |
| 9592 | + constexpr OutputIterator |
9591 | 9593 | adjacent_difference(InputIterator first, InputIterator last,
|
9592 | 9594 | OutputIterator result);
|
9593 | 9595 | template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
|
|
9596 | 9598 | ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result);
|
9597 | 9599 |
|
9598 | 9600 | template<class InputIterator, class OutputIterator, class BinaryOperation>
|
9599 |
| - OutputIterator |
| 9601 | + constexpr OutputIterator |
9600 | 9602 | adjacent_difference(InputIterator first, InputIterator last,
|
9601 | 9603 | OutputIterator result, BinaryOperation binary_op);
|
9602 | 9604 | template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
|
|
9679 | 9681 | \indexlibraryglobal{iota}%
|
9680 | 9682 | \begin{itemdecl}
|
9681 | 9683 | template<class ForwardIterator, class T>
|
9682 |
| - void iota(ForwardIterator first, ForwardIterator last, T value); |
| 9684 | + constexpr void iota(ForwardIterator first, ForwardIterator last, T value); |
9683 | 9685 | \end{itemdecl}
|
9684 | 9686 |
|
9685 | 9687 | \begin{itemdescr}
|
|
0 commit comments