|
2599 | 2599 |
|
2600 | 2600 | namespace ranges {
|
2601 | 2601 | template<class I, class O>
|
2602 |
| - using reverse_copy_result = in_out_result<I, O>; |
| 2602 | + using @\libglobal{reverse_copy_result}@ = in_out_result<I, O>; |
| 2603 | + template<class I, class O> |
| 2604 | + using @\libglobal{reverse_copy_truncated_result}@ = in_in_out_result<I, I, O>; |
2603 | 2605 |
|
2604 | 2606 | template<@\libconcept{bidirectional_iterator}@ I, @\libconcept{sentinel_for}@<I> S, @\libconcept{weakly_incrementable}@ O>
|
2605 | 2607 | requires @\libconcept{indirectly_copyable}@<I, O>
|
|
2613 | 2615 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
|
2614 | 2616 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS>
|
2615 | 2617 | requires @\libconcept{indirectly_copyable}@<I, O>
|
2616 |
| - reverse_copy_result<I, O> |
| 2618 | + reverse_copy_truncated_result<I, O> |
2617 | 2619 | reverse_copy(Ep&& exec, I first, S last, O result,
|
2618 | 2620 | OutS result_last); // freestanding-deleted
|
2619 | 2621 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR>
|
2620 | 2622 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>>
|
2621 |
| - reverse_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 2623 | + reverse_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
2622 | 2624 | reverse_copy(Ep&& exec, R&& r, OutR&& result_r); // freestanding-deleted
|
2623 | 2625 | }
|
2624 | 2626 |
|
|
2662 | 2664 |
|
2663 | 2665 | namespace ranges {
|
2664 | 2666 | template<class I, class O>
|
2665 |
| - using rotate_copy_result = in_out_result<I, O>; |
| 2667 | + using @\libglobal{rotate_copy_result}@ = in_out_result<I, O>; |
| 2668 | + template<class I, class O> |
| 2669 | + using @\libglobal{rotate_copy_truncated_result}@ = in_in_out_result<I, I, O>; |
2666 | 2670 |
|
2667 | 2671 | template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@<I> S, @\libconcept{weakly_incrementable}@ O>
|
2668 | 2672 | requires @\libconcept{indirectly_copyable}@<I, O>
|
|
2676 | 2680 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
|
2677 | 2681 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS>
|
2678 | 2682 | requires @\libconcept{indirectly_copyable}@<I, O>
|
2679 |
| - rotate_copy_result<I, O> |
| 2683 | + rotate_copy_truncated_result<I, O> |
2680 | 2684 | rotate_copy(Ep&& exec, I first, I middle, S last, O result, // freestanding-deleted
|
2681 | 2685 | OutS result_last);
|
2682 | 2686 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR>
|
2683 | 2687 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>>
|
2684 |
| - rotate_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 2688 | + rotate_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
2685 | 2689 | rotate_copy(Ep&& exec, R&& r, iterator_t<R> middle, // freestanding-deleted
|
2686 | 2690 | OutR&& result_r);
|
2687 | 2691 | }
|
|
8140 | 8144 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
|
8141 | 8145 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS>
|
8142 | 8146 | requires @\libconcept{indirectly_copyable}@<I, O>
|
8143 |
| - ranges::reverse_copy_result<I, O> |
| 8147 | + ranges::reverse_copy_truncated_result<I, O> |
8144 | 8148 | ranges::reverse_copy(Ep&& exec, I first, S last, O result,
|
8145 | 8149 | OutS result_last);
|
8146 | 8150 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR>
|
8147 | 8151 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>>
|
8148 |
| - ranges::reverse_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 8152 | + ranges::reverse_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
8149 | 8153 | ranges::reverse_copy(Ep&& exec, R&& r, OutR&& result_r);
|
8150 | 8154 | \end{itemdecl}
|
8151 | 8155 |
|
|
8169 | 8173 |
|
8170 | 8174 | \pnum
|
8171 | 8175 | \returns
|
8172 |
| -\tcode{\{\exposid{NEW_FIRST}, result + $N$\}}. |
8173 |
| -\begin{note} |
8174 |
| -While the return type for the parallel and non-parallel algorithm overloads |
8175 |
| -in the namespace \tcode{ranges} is the same, |
8176 |
| -the semantics is different |
8177 |
| -because for the parallel range algorithm overloads |
8178 |
| -\tcode{result_last - result} can be insufficient |
8179 |
| -to copy all data from the input. |
8180 |
| -\end{note} |
| 8176 | +\tcode{\{last, \exposid{NEW_FIRST}, result + $N$\}}. |
8181 | 8177 |
|
8182 | 8178 | \pnum
|
8183 | 8179 | \complexity
|
|
8320 | 8316 | template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@<I> S,
|
8321 | 8317 | @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@<O> OutS>
|
8322 | 8318 | requires @\libconcept{indirectly_copyable}@<I, O>
|
8323 |
| - ranges::rotate_copy_result<I, O> |
| 8319 | + ranges::rotate_copy_truncated_result<I, O> |
8324 | 8320 | ranges::rotate_copy(Ep&& exec, I first, I middle, S last, O result, OutS result_last);
|
8325 | 8321 | \end{itemdecl}
|
8326 | 8322 |
|
|
8346 | 8342 |
|
8347 | 8343 | \pnum
|
8348 | 8344 | \returns
|
8349 |
| -\tcode{\{first + ($N$ + (middle - first)) \% $M$, result + $N$\}}. |
8350 |
| -\begin{note} |
8351 |
| -While the return type for the parallel and non-parallel algorithm overloads |
8352 |
| -in the namespace \tcode{ranges} is the same, |
8353 |
| -the semantics is different |
8354 |
| -because for the parallel range algorithm overloads |
8355 |
| -\tcode{result_last - result} can be insufficient |
8356 |
| -to copy all data from the input. |
8357 |
| -\end{note} |
| 8345 | +\begin{itemize} |
| 8346 | +\item |
| 8347 | + \tcode{\{middle + $N$, first, result + $N$\}} |
| 8348 | + if $N$ is less than \tcode{last - middle}. |
| 8349 | +\item |
| 8350 | + Otherwise, |
| 8351 | + \tcode{\{last, first + ($N$ + (middle - first)) \% $M$, result + $N$\}}. |
| 8352 | +\end{itemize} |
8358 | 8353 |
|
8359 | 8354 | \pnum
|
8360 | 8355 | \complexity
|
|
8380 | 8375 | \begin{itemdecl}
|
8381 | 8376 | template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\exposconcept{sized-random-access-range}@ OutR>
|
8382 | 8377 | requires @\libconcept{indirectly_copyable}@<iterator_t<R>, iterator_t<OutR>>
|
8383 |
| - ranges::rotate_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
| 8378 | + ranges::rotate_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>> |
8384 | 8379 | ranges::rotate_copy(Ep&& exec, R&& r, iterator_t<R> middle, OutR&& result_r);
|
8385 | 8380 | \end{itemdecl}
|
8386 | 8381 |
|
|
0 commit comments