mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Merge branch 'patch-1' of https://github.com/rafzi/CppCoreGuidelines into rafzi-patch-1
This commit is contained in:
commit
11ee7e5626
|
@ -15415,10 +15415,10 @@ Pointers should not be used as arrays. `span` is a bounds-checked, safe alternat
|
||||||
void f()
|
void f()
|
||||||
{
|
{
|
||||||
int a[5];
|
int a[5];
|
||||||
span av = a;
|
span<int> av = a;
|
||||||
|
|
||||||
g(a.data(), a.length()); // OK, if you have no choice
|
g(av.data(), av.length()); // OK, if you have no choice
|
||||||
g1(a); // OK -- no decay here, instead use implicit span ctor
|
g1(av); // OK -- no decay here, instead use implicit span ctor
|
||||||
}
|
}
|
||||||
|
|
||||||
##### Enforcement
|
##### Enforcement
|
||||||
|
|
Loading…
Reference in New Issue
Block a user