From 11f58787b8a76fbe0537e4660bcca32733526350 Mon Sep 17 00:00:00 2001 From: Bjarne Stroustrup Date: Fri, 12 Oct 2018 15:12:49 -0400 Subject: [PATCH] minor clarifications for #1268 and #1267 --- CppCoreGuidelines.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index ee9f29e..56ac8a2 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -5560,7 +5560,7 @@ An initialization explicitly states that initialization, rather than assignment, class A { // Good string s1; public: - A(const char* p) : s1{p} { } // GOOD: directly construct + A(czstring p) : s1{p} { } // GOOD: directly construct (and the C-sting is explicitly named) // ... }; @@ -5580,7 +5580,7 @@ An initialization explicitly states that initialization, rather than assignment, // ... }; -##### Note: +##### Example, better still Instead of those `const char*`s we could `gsl::string_span or (in C++17) `std::string_view` as [a more general way to present arguments to a function](#Rstr-view): @@ -21761,7 +21761,8 @@ More information on many topics about C++ can be found on the [Standard C++ Foun Sometimes complexity is used to (simply) mean an estimate of the number of operations needed to execute an algorithm. * *computation*: the execution of some code, usually taking some input and producing some output. * *concept*: (1) a notion, and idea; (2) a set of requirements, usually for a template argument. -* *concrete class*: class for which objects can be created. +* *concrete class*: class for which objects can be created using usian construction syntax (e.g., on the stack) and the resulting object behaves much like an `int` as it comes to copying, comparison, and such +(as opposed to a base class in a hierarchy). * *constant*: a value that cannot be changed (in a given scope); not mutable. * *constructor*: an operation that initializes ("constructs") an object. Typically a constructor establishes an invariant and often acquires resources needed for an object to be used (which are then typically released by a destructor).