|
2608 | 2608 |
|
2609 | 2609 | namespace ranges { |
2610 | 2610 | template<class I, class O> |
2611 | | - using reverse_copy_result = in_out_result<I, O>; |
| 2611 | + using @\libglobal{reverse_copy_result}@ = in_out_result<I, O>; |
| 2612 | + template<class I, class O> |
| 2613 | + using @\libglobal{reverse_copy_truncated_result}@ = in_in_out_result<I, I, O>; |
2612 | 2614 |
|
2613 | 2615 | template<@\libconcept{bidirectional_iterator}@ I, @\libconcept{sentinel_for}@<I> S, @\libconcept{weakly_incrementable}@ O> |
2614 | 2616 | requires @\libconcept{indirectly_copyable}@<I, O> |
|
2622 | 2624 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S, |
2623 | 2625 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS> |
2624 | 2626 | requires @\libconcept{indirectly_copyable}@<I, O> |
2625 | | - reverse_copy_result<I, O> |
| 2627 | + reverse_copy_truncated_result<I, O> |
2626 | 2628 | reverse_copy(Ep&& exec, I first, S last, O result, |
2627 | 2629 | OutS result_last); // freestanding-deleted |
2628 | 2630 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> |
2629 | 2631 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>> |
2630 | | - reverse_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 2632 | + reverse_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
2631 | 2633 | reverse_copy(Ep&& exec, R&& r, OutR&& result_r); // freestanding-deleted |
2632 | 2634 | } |
2633 | 2635 |
|
|
2671 | 2673 |
|
2672 | 2674 | namespace ranges { |
2673 | 2675 | template<class I, class O> |
2674 | | - using rotate_copy_result = in_out_result<I, O>; |
| 2676 | + using @\libglobal{rotate_copy_result}@ = in_out_result<I, O>; |
| 2677 | + template<class I, class O> |
| 2678 | + using @\libglobal{rotate_copy_truncated_result}@ = in_in_out_result<I, I, O>; |
2675 | 2679 |
|
2676 | 2680 | template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@<I> S, @\libconcept{weakly_incrementable}@ O> |
2677 | 2681 | requires @\libconcept{indirectly_copyable}@<I, O> |
|
2686 | 2690 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S, |
2687 | 2691 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS> |
2688 | 2692 | requires @\libconcept{indirectly_copyable}@<I, O> |
2689 | | - ranges::rotate_copy_result<I, O> |
| 2693 | + ranges::rotate_copy_truncated_result<I, O> |
2690 | 2694 | ranges::rotate_copy(Ep&& exec, I first, I middle, S last, O result, |
2691 | 2695 | OutS result_last); // freestanding-deleted |
2692 | 2696 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> |
2693 | 2697 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>> |
2694 | | - ranges::rotate_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 2698 | + ranges::rotate_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
2695 | 2699 | ranges::rotate_copy(Ep&& exec, R&& r, iterator_t<R> middle, |
2696 | 2700 | OutR&& result_r); // freestanding-deleted |
2697 | 2701 | // FIXME: once ranges:: is removed, reflow the previous two lines into one |
|
8163 | 8167 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S, |
8164 | 8168 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS> |
8165 | 8169 | requires @\libconcept{indirectly_copyable}@<I, O> |
8166 | | - ranges::reverse_copy_result<I, O> |
| 8170 | + ranges::reverse_copy_truncated_result<I, O> |
8167 | 8171 | ranges::reverse_copy(Ep&& exec, I first, S last, O result, |
8168 | 8172 | OutS result_last); |
8169 | 8173 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> |
8170 | 8174 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>> |
8171 | | - ranges::reverse_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 8175 | + ranges::reverse_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
8172 | 8176 | ranges::reverse_copy(Ep&& exec, R&& r, OutR&& result_r); |
8173 | 8177 | \end{itemdecl} |
8174 | 8178 |
|
|
8194 | 8198 |
|
8195 | 8199 | \pnum |
8196 | 8200 | \returns |
8197 | | -\tcode{\{\exposid{NEW_FIRST}, result + $N$\}}. |
8198 | | -\begin{note} |
8199 | | -While the return type for the parallel and non-parallel algorithm overloads |
8200 | | -in the namespace \tcode{ranges} is the same, |
8201 | | -the semantics is different |
8202 | | -because for the parallel range algorithm overloads |
8203 | | -%FIXME: Comma. |
8204 | | -\tcode{result_last - result} can be insufficient |
8205 | | -to copy all data from the input. |
8206 | | -\end{note} |
| 8201 | +\tcode{\{last, \exposid{NEW_FIRST}, result + $N$\}}. |
8207 | 8202 |
|
8208 | 8203 | \pnum |
8209 | 8204 | \complexity |
|
8346 | 8341 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S, |
8347 | 8342 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS> |
8348 | 8343 | requires @\libconcept{indirectly_copyable}@<I, O> |
8349 | | - ranges::rotate_copy_result<I, O> |
| 8344 | + ranges::rotate_copy_truncated_result<I, O> |
8350 | 8345 | ranges::rotate_copy(Ep&& exec, I first, I middle, S last, O result, OutS result_last); |
8351 | 8346 | \end{itemdecl} |
8352 | 8347 |
|
|
8374 | 8369 |
|
8375 | 8370 | \pnum |
8376 | 8371 | \returns |
8377 | | -\tcode{\{first + ($N$ + (middle - first)) \% $M$, result + $N$\}}. |
8378 | | -\begin{note} |
8379 | | -While the return type for the parallel and non-parallel algorithm overloads |
8380 | | -in the namespace \tcode{ranges} is the same, |
8381 | | -the semantics is different |
8382 | | -because for the parallel range algorithm overloads |
8383 | | -%FIXME: Comma. |
8384 | | -\tcode{result_last - result} can be insufficient |
8385 | | -to copy all data from the input. |
8386 | | -\end{note} |
| 8372 | +\begin{itemize} |
| 8373 | +\item |
| 8374 | + \tcode{\{middle + $N$, first, result + $N$\}} |
| 8375 | + if $N$ is less than \tcode{last - middle}. |
| 8376 | +\item |
| 8377 | + Otherwise, |
| 8378 | + \tcode{\{last, first + ($N$ + (middle - first)) \% $M$, result + $N$\}}. |
| 8379 | +\end{itemize} |
8387 | 8380 |
|
8388 | 8381 | \pnum |
8389 | 8382 | \complexity |
|
8409 | 8402 | \begin{itemdecl} |
8410 | 8403 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR> |
8411 | 8404 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>> |
8412 | | - ranges::rotate_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 8405 | + ranges::rotate_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
8413 | 8406 | ranges::rotate_copy(Ep&& exec, R&& r, iterator_t<R> middle, OutR&& result_r); |
8414 | 8407 | \end{itemdecl} |
8415 | 8408 |
|
|
0 commit comments