From Jason Turner

[mdspan.mdspan.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpblvqo8me/{from.md → to.md} +164 -0
tmp/tmpblvqo8me/{from.md → to.md} RENAMED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##### Constructors <a id="mdspan.mdspan.cons">[[mdspan.mdspan.cons]]</a>
2
+
3
+ ``` cpp
4
+ constexpr mdspan();
5
+ ```
6
+
7
+ *Constraints:*
8
+
9
+ - `rank_dynamic() > 0` is `true`.
10
+ - `is_default_constructible_v<data_handle_type>` is `true`.
11
+ - `is_default_constructible_v<mapping_type>` is `true`.
12
+ - `is_default_constructible_v<accessor_type>` is `true`.
13
+
14
+ *Preconditions:* $[0, \texttt{\textit{map_}.required_span_size()})$ is
15
+ an accessible range of *ptr\_* and *acc\_* for the values of *map\_* and
16
+ *acc\_* after the invocation of this constructor.
17
+
18
+ *Effects:* Value-initializes *ptr\_*, *map\_*, and *acc\_*.
19
+
20
+ ``` cpp
21
+ template<class... OtherIndexTypes>
22
+ constexpr explicit mdspan(data_handle_type p, OtherIndexTypes... exts);
23
+ ```
24
+
25
+ Let `N` be `sizeof...(OtherIndexTypes)`.
26
+
27
+ *Constraints:*
28
+
29
+ - `(is_convertible_v<OtherIndexTypes, index_type> && ...)` is `true`,
30
+ - `(is_nothrow_constructible<index_type, OtherIndexTypes> && ...)` is
31
+ `true`,
32
+ - `N == rank() || N == rank_dynamic()` is `true`,
33
+ - `is_constructible_v<mapping_type, extents_type>` is `true`, and
34
+ - `is_default_constructible_v<accessor_type>` is `true`.
35
+
36
+ *Preconditions:* $[0, \texttt{\textit{map_}.required_span_size()})$ is
37
+ an accessible range of `p` and *acc\_* for the values of *map\_* and
38
+ *acc\_* after the invocation of this constructor.
39
+
40
+ *Effects:*
41
+
42
+ - Direct-non-list-initializes *ptr\_* with `std::move(p)`,
43
+ - direct-non-list-initializes *map\_* with
44
+ `extents_type(static_cast<index_type>(std::move(exts))...)`, and
45
+ - value-initializes *acc\_*.
46
+
47
+ ``` cpp
48
+ template<class OtherIndexType, size_t N>
49
+ constexpr explicit(N != rank_dynamic())
50
+ mdspan(data_handle_type p, span<OtherIndexType, N> exts);
51
+ template<class OtherIndexType, size_t N>
52
+ constexpr explicit(N != rank_dynamic())
53
+ mdspan(data_handle_type p, const array<OtherIndexType, N>& exts);
54
+ ```
55
+
56
+ *Constraints:*
57
+
58
+ - `is_convertible_v<const OtherIndexType&, index_type>` is `true`,
59
+ - `(is_nothrow_constructible<index_type, const OtherIndexType&> && ...)`
60
+ is `true`,
61
+ - `N == rank() || N == rank_dynamic()` is `true`,
62
+ - `is_constructible_v<mapping_type, extents_type>` is `true`, and
63
+ - `is_default_constructible_v<accessor_type>` is `true`.
64
+
65
+ *Preconditions:* $[0, \texttt{\textit{map_}.required_span_size()})$ is
66
+ an accessible range of `p` and *acc\_* for the values of *map\_* and
67
+ *acc\_* after the invocation of this constructor.
68
+
69
+ *Effects:*
70
+
71
+ - Direct-non-list-initializes *ptr\_* with `std::move(p)`,
72
+ - direct-non-list-initializes *map\_* with `extents_type(exts)`, and
73
+ - value-initializes *acc\_*.
74
+
75
+ ``` cpp
76
+ constexpr mdspan(data_handle_type p, const extents_type& ext);
77
+ ```
78
+
79
+ *Constraints:*
80
+
81
+ - `is_constructible_v<mapping_type, const extents_type&>` is `true`, and
82
+ - `is_default_constructible_v<accessor_type>` is `true`.
83
+
84
+ *Preconditions:* $[0, \texttt{\textit{map_}.required_span_size()})$ is
85
+ an accessible range of `p` and *acc\_* for the values of *map\_* and
86
+ *acc\_* after the invocation of this constructor.
87
+
88
+ *Effects:*
89
+
90
+ - Direct-non-list-initializes *ptr\_* with `std::move(p)`,
91
+ - direct-non-list-initializes *map\_* with `ext`, and
92
+ - value-initializes *acc\_*.
93
+
94
+ ``` cpp
95
+ constexpr mdspan(data_handle_type p, const mapping_type& m);
96
+ ```
97
+
98
+ *Constraints:* `is_default_constructible_v<accessor_type>` is `true`.
99
+
100
+ *Preconditions:* [0, `m.required_span_size()`) is an accessible range of
101
+ `p` and *acc\_* for the value of *acc\_* after the invocation of this
102
+ constructor.
103
+
104
+ *Effects:*
105
+
106
+ - Direct-non-list-initializes *ptr\_* with `std::move(p)`,
107
+ - direct-non-list-initializes *map\_* with `m`, and
108
+ - value-initializes *acc\_*.
109
+
110
+ ``` cpp
111
+ constexpr mdspan(data_handle_type p, const mapping_type& m, const accessor_type& a);
112
+ ```
113
+
114
+ *Preconditions:* [0, `m.required_span_size()`) is an accessible range of
115
+ `p` and `a`.
116
+
117
+ *Effects:*
118
+
119
+ - Direct-non-list-initializes *ptr\_* with `std::move(p)`,
120
+ - direct-non-list-initializes *map\_* with `m`, and
121
+ - direct-non-list-initializes *acc\_* with `a`.
122
+
123
+ ``` cpp
124
+ template<class OtherElementType, class OtherExtents,
125
+ class OtherLayoutPolicy, class OtherAccessor>
126
+ constexpr explicit(see below)
127
+ mdspan(const mdspan<OtherElementType, OtherExtents,
128
+ OtherLayoutPolicy, OtherAccessor>& other);
129
+ ```
130
+
131
+ *Constraints:*
132
+
133
+ - `is_constructible_v<mapping_type, const OtherLayoutPolicy::template mapping<Oth- erExtents>&>`
134
+ is `true`, and
135
+ - `is_constructible_v<accessor_type, const OtherAccessor&>` is `true`.
136
+
137
+ *Mandates:*
138
+
139
+ - `is_constructible_v<data_handle_type, const OtherAccessor::data_handle_type&>`
140
+ is `true`, and
141
+ - `is_constructible_v<extents_type, OtherExtents>` is `true`.
142
+
143
+ *Preconditions:*
144
+
145
+ - For each rank index `r` of `extents_type`,
146
+ `static_extent(r) == dynamic_extent || static_extent(r) == other.extent(r)`
147
+ is `true`.
148
+ - $[0, \texttt{\textit{map_}.required_span_size()})$ is an accessible
149
+ range of *ptr\_* and *acc\_* for values of *ptr\_*, *map\_*, and
150
+ *acc\_* after the invocation of this constructor.
151
+
152
+ *Effects:*
153
+
154
+ - Direct-non-list-initializes *ptr\_* with `other.`*`ptr_`*,
155
+ - direct-non-list-initializes *map\_* with `other.`*`map_`*, and
156
+ - direct-non-list-initializes *acc\_* with `other.`*`acc_`*.
157
+
158
+ *Remarks:* The expression inside `explicit` is equivalent to:
159
+
160
+ ``` cpp
161
+ !is_convertible_v<const OtherLayoutPolicy::template mapping<OtherExtents>&, mapping_type>
162
+ || !is_convertible_v<const OtherAccessor&, accessor_type>
163
+ ```
164
+