From 109f00847a57412cd0b5398af5610090366f99d9 Mon Sep 17 00:00:00 2001 From: rafzi Date: Sat, 23 Apr 2016 22:36:45 +0200 Subject: [PATCH] Fix bounds.3 example --- CppCoreGuidelines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index d278e5e..4bc9c1c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -15316,10 +15316,10 @@ Pointers should not be used as arrays. `span` is a bounds-checked, safe alternat void f() { int a[5]; - span av = a; + span av = a; - g(a.data(), a.length()); // OK, if you have no choice - g1(a); // OK - no decay here, instead use implicit span ctor + g(av.data(), av.length()); // OK, if you have no choice + g1(av); // OK - no decay here, instead use implicit span ctor } ##### Enforcement