diff --git a/source/algorithms.tex b/source/algorithms.tex index c459fb799f..7a4dbaacfe 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -2599,7 +2599,9 @@ namespace ranges { template - using reverse_copy_result = in_out_result; + using @\libglobal{reverse_copy_result}@ = in_out_result; + template + using @\libglobal{reverse_copy_truncated_result}@ = in_in_out_result; template<@\libconcept{bidirectional_iterator}@ I, @\libconcept{sentinel_for}@ S, @\libconcept{weakly_incrementable}@ O> requires @\libconcept{indirectly_copyable}@ @@ -2613,12 +2615,12 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@ OutS> requires @\libconcept{indirectly_copyable}@ - reverse_copy_result + reverse_copy_truncated_result reverse_copy(Ep&& exec, I first, S last, O result, OutS result_last); // freestanding-deleted template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> requires @\libconcept{indirectly_copyable}@, iterator_t> - reverse_copy_result, borrowed_iterator_t> + reverse_copy_truncated_result, borrowed_iterator_t> reverse_copy(Ep&& exec, R&& r, OutR&& result_r); // freestanding-deleted } @@ -2662,7 +2664,9 @@ namespace ranges { template - using rotate_copy_result = in_out_result; + using @\libglobal{rotate_copy_result}@ = in_out_result; + template + using @\libglobal{rotate_copy_truncated_result}@ = in_in_out_result; template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@ S, @\libconcept{weakly_incrementable}@ O> requires @\libconcept{indirectly_copyable}@ @@ -2676,12 +2680,12 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@ OutS> requires @\libconcept{indirectly_copyable}@ - rotate_copy_result + rotate_copy_truncated_result rotate_copy(Ep&& exec, I first, I middle, S last, O result, // freestanding-deleted OutS result_last); template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> requires @\libconcept{indirectly_copyable}@, iterator_t> - rotate_copy_result, borrowed_iterator_t> + rotate_copy_truncated_result, borrowed_iterator_t> rotate_copy(Ep&& exec, R&& r, iterator_t middle, // freestanding-deleted OutR&& result_r); } @@ -8140,12 +8144,12 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@ OutS> requires @\libconcept{indirectly_copyable}@ - ranges::reverse_copy_result + ranges::reverse_copy_truncated_result ranges::reverse_copy(Ep&& exec, I first, S last, O result, OutS result_last); template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> requires @\libconcept{indirectly_copyable}@, iterator_t> - ranges::reverse_copy_result, borrowed_iterator_t> + ranges::reverse_copy_truncated_result, borrowed_iterator_t> ranges::reverse_copy(Ep&& exec, R&& r, OutR&& result_r); \end{itemdecl} @@ -8169,15 +8173,7 @@ \pnum \returns -\tcode{\{\exposid{NEW_FIRST}, result + $N$\}}. -\begin{note} -While the return type for the parallel and non-parallel algorithm overloads -in the namespace \tcode{ranges} is the same, -the semantics is different -because for the parallel range algorithm overloads -\tcode{result_last - result} can be insufficient -to copy all data from the input. -\end{note} +\tcode{\{last, \exposid{NEW_FIRST}, result + $N$\}}. \pnum \complexity @@ -8320,7 +8316,7 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@ OutS> requires @\libconcept{indirectly_copyable}@ - ranges::rotate_copy_result + ranges::rotate_copy_truncated_result ranges::rotate_copy(Ep&& exec, I first, I middle, S last, O result, OutS result_last); \end{itemdecl} @@ -8346,15 +8342,14 @@ \pnum \returns -\tcode{\{first + ($N$ + (middle - first)) \% $M$, result + $N$\}}. -\begin{note} -While the return type for the parallel and non-parallel algorithm overloads -in the namespace \tcode{ranges} is the same, -the semantics is different -because for the parallel range algorithm overloads -\tcode{result_last - result} can be insufficient -to copy all data from the input. -\end{note} +\begin{itemize} +\item + \tcode{\{middle + $N$, first, result + $N$\}} + if $N$ is less than \tcode{last - middle}. +\item + Otherwise, + \tcode{\{last, first + ($N$ + (middle - first)) \% $M$, result + $N$\}}. +\end{itemize} \pnum \complexity @@ -8380,7 +8375,7 @@ \begin{itemdecl} template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> requires @\libconcept{indirectly_copyable}@, iterator_t> - ranges::rotate_copy_result, borrowed_iterator_t> + ranges::rotate_copy_truncated_result, borrowed_iterator_t> ranges::rotate_copy(Ep&& exec, R&& r, iterator_t middle, OutR&& result_r); \end{itemdecl}