11---
22title : mdspan.at()
3- document : P3383R1
3+ document : P3383R2
44date : today
55audience :
66- Library Evolution Working Group (LEWG)
@@ -19,6 +19,11 @@ This paper proposes element access with bounds checking to `std::mdspan` via `at
1919
2020# Revision history
2121
22+ ## R2
23+
24+ - Remove feature test macro bump requested by LEWG
25+ - Adapt wording to follow same pattern like ` operator[] ` and rebase on top of latest draft
26+
2227## R1
2328
2429Update wording to align with [ @P2821R5 ] :
@@ -48,9 +53,7 @@ One consideration is that the `at()` method has previously not been used with mu
4853
4954# Wording
5055
51- The wording is relative to [ @N4993 ] .
52-
53- In 17.3.2 ([[ version.syn]] ( https://eel.is/c++draft/version.syn ) ), adjust the value of ` __cpp_lib_mdspan ` to the date of this proposal's adoption.
56+ The wording is relative to [ @N5001 ] .
5457
5558In 23.7.3.2 ([[ mdspan.syn]] ( https://eel.is/c++draft/mdspan.syn ) ), change the following lines:
5659
@@ -97,11 +100,11 @@ In 23.7.3.6.3 ([[mdspan.mdspan.members]](https://eel.is/c++draft/mdspan.mdspan.m
97100> - [7.2]{.pnum} `(is_nothrow_constructible_v<index_type, OtherIndexTypes> && ...)` is `true`, and
98101> - [7.3]{.pnum} `sizeof...(OtherIndexTypes) == rank()` is `true`.
99102>
100- > [8]{.pnum} *Returns:* `(*this)[indices...]`
103+ > [8]{.pnum} *Returns:* `(*this)[indices...]`.
101104>
102- > [9]{.pnum} *Throws:* `out_of_range` if\
103- > `indices_v[i] >= extent(i) || indices_v[i] < 0`\
104- > for any `indices_v[i]` in `vector<OtherIndexTypes>({indices...} )`.
105+ > [9]{.pnum} Let `I` be `extents_type::`*`index_cast`*`(std::move(indices))`.
106+ >
107+ > [10]{.pnum} *Throws:* `out_of_range` if `I` is not a multidimensional index in `extents( )`.
105108>
106109> ```
107110> template<class OtherIndexType>
@@ -111,19 +114,30 @@ In 23.7.3.6.3 ([[mdspan.mdspan.members]](https://eel.is/c++draft/mdspan.mdspan.m
111114> template<class OtherIndexType>
112115> constexpr reference at(const array<OtherIndexType, rank()>& indices) const;
113116> ```
114- > [10]{.pnum} *Constraints:*
115- >
116- > - [10.1]{.pnum} `is_convertible_v<const OtherIndexType&, index_type>` is `true`, and
117- > - [10.2]{.pnum} `is_nothrow_constructible_v<index_type, const OtherIndexType&>` is `true`.
117+ > [11]{.pnum} *Constraints:*
118118>
119- > [11]{.pnum} *Returns:* `(*this)[indices]`
119+ > - [11.1]{.pnum} `is_convertible_v<const OtherIndexType&, index_type>` is `true`, and
120+ > - [11.2]{.pnum} `is_nothrow_constructible_v<index_type, const OtherIndexType&>` is `true`.
120121>
121- > [12]{.pnum} *Throws:* `out_of_range` if\
122- > `indices[i] >= extent(i) || indices[i] < 0`\
123- > for any `indices[i]` in `indices`.
122+ > [12]{.pnum} *Effects:* Let `P` be a parameter pack such that
123+ > `is_same_v<make_index_sequence<rank()>, index_sequence<P...>>`
124+ > is `true`. Equivalent to:
125+ > `return at(extents_type::`*`index-cast`*`(as_const(indices[P]))...);`
124126
125127:::
126128
129+ # Feature Test Macro
130+
131+ LEWG decided to drop the bump of the feature test macro.
132+
133+ ## Poll
134+
135+ Remove the feature test macro bump from P3383R1
136+
137+ | SF | F | N | A | SA |
138+ |----|---|---|---|----|
139+ | 4 | 4 | 4 | 2 | 0 |
140+
127141# Reference Implementation
128142
129143The `at()` member functions have been implemented in the `std::mdspan` reference implementation from the Kokkos project at Sandia National Laboratories [@kokkos/mdspan], see [@kokkos/mdspan#302].
0 commit comments