From 369a5be4245131a81f104dd6f9b2ec540244769e Mon Sep 17 00:00:00 2001 From: Herb Sutter Date: Thu, 30 Sep 2021 11:30:59 -0700 Subject: [PATCH] Made `char*` advice more consistent, closes #1826 --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index bfb3668..030ce7c 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -21194,8 +21194,8 @@ A `char*` that points to more than one `char` but is not a C-style string (e.g., * `czstring` // a `const char*` supposed to be a C-style string; that is, a zero-terminated sequence of `const` `char` or `nullptr` Logically, those last two aliases are not needed, but we are not always logical, and they make the distinction between a pointer to one `char` and a pointer to a C-style string explicit. -A sequence of characters that is not assumed to be zero-terminated should be a `char*`, rather than a `zstring`. -French accent optional. +A sequence of characters that is not assumed to be zero-terminated should be a `span`, or if that is impossible because of ABI issues a `char*`, rather than a `zstring`. + Use `not_null` for C-style strings that cannot be `nullptr`. ??? Do we need a name for `not_null`? or is its ugliness a feature?