@@ -38,6 +38,7 @@ The following differences to the standard serial C++ range algorithms apply:
38
38
rather than ``std::ranges::reverse_copy_result ``.
39
39
The semantics of the returned value are as specified in
40
40
`P3709R2 <https://isocpp.org/files/papers/P3709R2.html >`_.
41
+ - ``destroy `` is not marked with ``noexcept ``.
41
42
42
43
[*Note *: These oneDPL algorithms mostly match the semantics of the parallel range algorithms in the C++26 working draft.
43
44
-- *end note *]
@@ -51,9 +52,25 @@ of parallel range algorithms.
51
52
.. code :: cpp
52
53
53
54
// C++20 analogue of std::projected_value_t; exposition only
54
- template<typename I, typename Proj>
55
+ template <typename I, typename Proj>
55
56
using /*projected-value-type*/ = std::remove_cvref_t<std::invoke_result_t<Proj&, std::iter_value_t<I>&>>;
56
57
58
+ // C++20 analogue of nothrow-random-access-range in the C++26 working draft; exposition only
59
+ // Semantic requirements are listed further below
60
+ template <typename R>
61
+ concept nothrow-random-access-range =
62
+ std::ranges::random_access_range<R> &&
63
+ std::is_lvalue_reference_v<std::iter_reference_t<std::ranges::iterator_t<R>>> &&
64
+ std::same_as<std::remove_cvref_t<std::iter_reference_t<std::ranges::iterator_t<R>>>,
65
+ std::iter_value_t<std::ranges::iterator_t<R>>>;
66
+
67
+ A type ``R `` models ``nothrow-random-access-range `` if no exceptions are thrown from:
68
+
69
+ - any operation on an object of type ``std::ranges::iterator_t<R> ``
70
+ required by the ``std::random_access_iterator `` concept;
71
+ - calls to ``std::ranges::begin() ``, ``std::ranges::end() `` and ``std::ranges::size() ``
72
+ on an object of type ``R ``.
73
+
57
74
Whole Sequence Operations
58
75
+++++++++++++++++++++++++
59
76
@@ -293,7 +310,6 @@ Sequence Search and Comparison
293
310
std::ranges::borrowed_iterator_t<R2>>
294
311
mismatch (ExecutionPolicy&& pol, R1&& r1, R2&& r2, Pred pred = {},
295
312
Proj1 proj1 = {}, Proj2 proj2 = {});
296
-
297
313
298
314
// find_end
299
315
template<typename ExecutionPolicy, std::ranges::random_access_range R1,
@@ -581,5 +597,71 @@ In-place Mutating Operations
581
597
582
598
}
583
599
600
+ Uninitialized Memory Algorithms
601
+ +++++++++++++++++++++++++++++++
602
+
603
+ .. code :: cpp
604
+
605
+ // Defined in <oneapi/dpl/memory>
606
+
607
+ namespace oneapi::dpl::ranges {
608
+
609
+ // uninitialized_default_construct
610
+ template <typename ExecutionPolicy, /*nothrow-random-access-range*/ R>
611
+ requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
612
+ std::ranges::sized_range<R> &&
613
+ std::default_initializable<std::ranges::range_value_t<R>>
614
+ std::ranges::borrowed_iterator_t<R>
615
+ uninitialized_default_construct (ExecutionPolicy&& pol, R&& r);
616
+
617
+ // uninitialized_value_construct
618
+ template <typename ExecutionPolicy, /*nothrow-random-access-range*/ R>
619
+ requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
620
+ std::ranges::sized_range<R> &&
621
+ std::default_initializable<std::ranges::range_value_t<R>>
622
+ std::ranges::borrowed_iterator_t<R>
623
+ uninitialized_value_construct (ExecutionPolicy&& pol, R&& r);
624
+
625
+ // uninitialized_copy
626
+ template <typename ExecutionPolicy, std::random_access_range IR,
627
+ /*nothrow-random-access-range*/ OR>
628
+ requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
629
+ std::ranges::sized_range<IR> && std::ranges::sized_range<OR> &&
630
+ std::constructible_from<std::ranges::range_value_t<OR>,
631
+ std::ranges::range_reference_t<IR>>
632
+ std::ranges::uninitialized_copy_result<std::ranges::borrowed_iterator_t<IR>,
633
+ std::ranges::borrowed_iterator_t<OR>>
634
+ uninitialized_copy (ExecutionPolicy&& pol, IR&& in_range, OR&& out_range);
635
+
636
+ // uninitialized_move
637
+ template <typename ExecutionPolicy, std::ranges::random_access_range IR,
638
+ /*nothrow-random-access-range*/ OR>
639
+ requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
640
+ std::ranges::sized_range<IR> && std::ranges::sized_range<OR> &&
641
+ std::constructible_from<std::ranges::range_value_t<OR>,
642
+ std::ranges::range_rvalue_reference_t<IR>>
643
+ std::ranges::uninitialized_move_result<std::ranges::borrowed_iterator_t<IR>,
644
+ std::ranges::borrowed_iterator_t<OR>>
645
+ uninitialized_move (ExecutionPolicy&& pol, IR&& in_range, OR&& out_range);
646
+
647
+ // uninitialized_fill
648
+ template <typename ExecutionPolicy, /*nothrow-random-access-range*/ R,
649
+ typename T = std::ranges::range_value_t<R>>
650
+ requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
651
+ std::ranges::sized_range<R> &&
652
+ std::constructible_from<std::ranges::range_value_t<R>, const T&>
653
+ std::ranges::borrowed_iterator_t<R>
654
+ uninitialized_fill (ExecutionPolicy&& pol, R&& r, const T& value);
655
+
656
+ // destroy
657
+ template <typename ExecutionPolicy, /*nothrow-random-access-range*/ R>
658
+ requires oneapi::dpl::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> &&
659
+ std::ranges::sized_range<R> &&
660
+ std::destructible<std::ranges::range_value_t<R>>
661
+ std::ranges::borrowed_iterator_t<R>
662
+ destroy (ExecutionPolicy&& pol, R&& r);
663
+
664
+ }
665
+
584
666
.. _`C++ Standard` : https://isocpp.org/std/the-standard
585
667
.. _`SYCL` : https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html
0 commit comments