Skip to content

Commit 109f008

Browse files
committed
Fix bounds.3 example
1 parent e8dea38 commit 109f008

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CppCoreGuidelines.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15316,10 +15316,10 @@ Pointers should not be used as arrays. `span` is a bounds-checked, safe alternat
1531615316
void f()
1531715317
{
1531815318
int a[5];
15319-
span av = a;
15319+
span<int> av = a;
1532015320

15321-
g(a.data(), a.length()); // OK, if you have no choice
15322-
g1(a); // OK - no decay here, instead use implicit span ctor
15321+
g(av.data(), av.length()); // OK, if you have no choice
15322+
g1(av); // OK - no decay here, instead use implicit span ctor
1532315323
}
1532415324

1532515325
##### Enforcement

0 commit comments

Comments
 (0)