From 8d5d5e4aeb11ba6c83c4dc1645f59109a9de4f1b Mon Sep 17 00:00:00 2001 From: hsutter Date: Mon, 5 Mar 2018 10:51:31 -0800 Subject: [PATCH] To address #1147 Changed `.length()` to `.size()` for `span` examples to track standardization changes. --- CppCoreGuidelines.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 0db1954..4183940 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -10854,13 +10854,13 @@ Access into an array with known bounds using a constant as a subscript can be va void f(span a) // BETTER: use span in the function declaration { - if (a.length() < 2) return; + if (a.size() < 2) return; int n = a[0]; // OK span q = a.subspan(1); // OK - if (a.length() < 6) return; + if (a.size() < 6) return; a[4] = 1; // OK @@ -10997,8 +10997,8 @@ If you want to pass an array, say so: int a[5]; span av = a; - g(av.data(), av.length()); // OK, if you have no choice - g1(a); // OK -- no decay here, instead use implicit span ctor + g(av.data(), av.size()); // OK, if you have no choice + g1(a); // OK -- no decay here, instead use implicit span ctor } ##### Enforcement