Skip to content

Commit 3e41403

Browse files
burblebeetkoeppe
authored andcommitted
LWG4060 submdspan preconditions do not forbid creating invalid pointer
1 parent b3f7a0c commit 3e41403

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

source/containers.tex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23392,7 +23392,13 @@
2339223392
is \tcode{true}.
2339323393

2339423394
\pnum
23395-
Let \tcode{offset} be a value of type \tcode{size_t} equal to
23395+
If \tcode{\exposid{first_}<index_type, $k$>(slices...)}
23396+
equals \tcode{extents().extent($k$)}
23397+
for any rank index $k$ of \tcode{extents()}, then
23398+
let \tcode{offset} be a value of type \tcode{size_t} equal to
23399+
\tcode{(*this).required_span_size()}.
23400+
Otherwise,
23401+
let \tcode{offset} be a value of type \tcode{size_t} equal to
2339623402
\tcode{(*this)(\exposid{first_}<index_type, P>(slices...)...)}.
2339723403

2339823404
\rSec5[mdspan.sub.map.left]{\tcode{layout_left} specialization of \tcode{submdspan_mapping}}
@@ -23840,9 +23846,9 @@
2384023846
\effects
2384123847
Equivalent to:
2384223848
\begin{codeblock}
23843-
auto sub_map_offset = submdspan_mapping(src.mapping(), slices...);
23844-
return mdspan(src.accessor().offset(src.data(), sub_map_offset.offset),
23845-
sub_map_offset.mapping,
23849+
auto sub_map_result = submdspan_mapping(src.mapping(), slices...);
23850+
return mdspan(src.accessor().offset(src.data(), sub_map_result.offset),
23851+
sub_map_result.mapping,
2384623852
AccessorPolicy::offset_policy(src.accessor()));
2384723853
\end{codeblock}
2384823854
\end{itemdescr}

0 commit comments

Comments
 (0)