@@ -47,35 +47,29 @@ of parallel range algorithms.
47
47
.. code :: cpp
48
48
49
49
// C++20 analogue of std::projected_value_t; exposition only
50
- template<typename I, typename Proj>
50
+ template <typename I, typename Proj>
51
51
using /*projected-value-type*/ = std::remove_cvref_t<std::invoke_result_t<Proj&, std::iter_value_t<I>&>>;
52
52
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
+ - increment, decrement, copy construction, move construction, copy assignment, move assignment,
66
+ comparisons or indirection through valid iterators of type ``std::ranges::iterator_t<R> ``;
67
+ - ``- `` operator, copy construction, move construction, copy assignment, move assignment,
68
+ or comparisons between valid values of type ``std::ranges::iterator_t<R> `` and ``std::ranges::sentinel_t<R> ``;
69
+ - ``- ``, ``+ ``, ``-= ``, ``+= ``, ``[] `` operators on valid values of type
70
+ ``std::ranges::iterator_t<R> `` and ``std::iter_difference_t<std::ranges::iterator_t<R>> ``;
71
+ - calls to ``std::ranges::begin() ``, ``std::ranges::end() `` and ``std::ranges::size() ``
72
+ on an object of type ``R ``.
79
73
80
74
Whole Sequence Operations
81
75
+++++++++++++++++++++++++
0 commit comments