Skip to content

Commit 0dc211c

Browse files
Keep only nothrow-random-access-range and its semantic requirements
1 parent a4516c2 commit 0dc211c

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

source/elements/oneDPL/source/parallel_api/parallel_range_api.rst

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,30 @@ of parallel range algorithms.
4747
.. code:: cpp
4848
4949
// C++20 analogue of std::projected_value_t; exposition only
50-
template<typename I, typename Proj>
50+
template <typename I, typename Proj>
5151
using /*projected-value-type*/ = std::remove_cvref_t<std::invoke_result_t<Proj&, std::iter_value_t<I>&>>;
5252
53-
// Extension of C++20 exposition-only special memory concepts as defined in [special.mem.concepts]
54-
template<typename S, typename I>
55-
concept no-throw-sized-sentinel-for = // exposition only
56-
no-throw-sentinel-for<S, I> &&
57-
std::sized_sentinel_for<S, I>;
58-
59-
template<typename I>
60-
concept no-throw-bidirectional-iterator = // exposition only
61-
no-throw-forward-iterator<I> &&
62-
std::bidirectional_iterator<I>;
63-
64-
template<typename I>
65-
concept no-throw-random-access-iterator = // exposition only
66-
no-throw-bidirectional-iterator<I> &&
67-
std::random_access_iterator<I> &&
68-
no-throw-sized-sentinel-for<I, I>;
69-
70-
template<typename R>
71-
concept no-throw-bidirectional-range = // exposition only
72-
no-throw-forward-range<R> &&
73-
no-throw-bidirectional-iterator<std::ranges::iterator_t<R>>;
74-
75-
template<typename R>
76-
concept no-throw-random-access-range = // exposition only
77-
no-throw-bidirectional-range<R> &&
78-
no-throw-random-access-iterator<std::ranges::iterator_t<R>>;
53+
// C++20 analogue of nothrow-random-access-range proposed for C++26 in P3179R9; exposition only
54+
template <typename R>
55+
concept nothrow-random-access-range =
56+
std::ranges::random_access_range<R> &&
57+
std::is_lvalue_reference_v<std::iter_reference_t<I>> &&
58+
std::same_as<std::remove_cvref_t<std::iter_reference_t<I>>, std::iter_value_t<I>> &&
59+
std::sized_sentinel_for<std::ranges::sentinel_t<R>, std::ranges::iterator_t<R>>;
60+
61+
Semantic Requirements
62+
~~~~~~~~~~~~~~~~~~~~
63+
64+
A type ``R`` models ``nothrow-random-access-range`` if no exceptions are thrown from:
65+
66+
- increment, decrement, copy construction, move construction, copy assignment, move assignment,
67+
comparisons or indirection through valid iterators of type ``std::ranges::iterator_t<R>``;
68+
- ``-`` operator, copy construction, move construction, copy assignment, move assignment,
69+
or comparisons between valid values of type ``std::ranges::iterator_t<R>`` and ``std::ranges::sentinel_t<R>``;
70+
- ``-``, ``+``, ``-=``, ``+=``, ``[]`` operators on valid values of type
71+
``std::ranges::iterator_t<R>`` and ``std::iter_difference_t<std::ranges::iterator_t<R>>``;
72+
- calls to ``std::ranges::begin()``, ``std::ranges::end()`` and ``std::ranges::size()``
73+
on an object of type ``R``.
7974

8075
Whole Sequence Operations
8176
+++++++++++++++++++++++++

0 commit comments

Comments
 (0)