From 2f6c3d5c2b94e175c7e5642e00e695440158001f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Mon, 5 Oct 2015 12:36:28 +0100 Subject: [PATCH] [GSL.view] Simplify explanation of lack of "null references". --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 268b5c2..109da4f 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -12174,7 +12174,7 @@ The names are mostly ISO standard-library style (lower case and underscore): * `T*` // The `T*` is not an owner, may be null; assumed to be pointing to a single element. * `char*` // A C-style string (a zero-terminated array of characters); may be null. * `const char*` // A C-style string; may be null. -* `T&` // The `T&` is not an owner, must not be `*static_cast(nullptr)` (language rule; there are no "null references"). +* `T&` // The `T&` is not an owner and can never be a "null reference"; references are always bound to objects. The "raw-pointer" notation (e.g. `int*`) is assumed to have its most common meaning; that is, a pointer points to an object, but does not own it. Owners should be converted to resource handles (e.g., `unique_ptr` or `vector`) or marked `owner`