Skip to content

Commit 2aa7f40

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2392 from JordanMaples/patch-17
Add C++ Core Guidelines link to C26429
2 parents 9623cd3 + 15871d8 commit 2aa7f40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/code-quality/c26429.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: 4e1c74d5-7307-436c-927b-f74ae863282c
1212
"Symbol is never tested for nullness, it can be marked as gsl::not_null."
1313

1414
**C++ Core Guidelines**:
15-
F.23: Use a not_null\<T> to indicate that "null" is not a valid value
15+
[F.23](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#f23-use-a-not_nullt-to-indicate-that-null-is-not-a-valid-value): Use a not_null\<T> to indicate that "null" is not a valid value
1616

1717
It is a common practice to use asserts to enforce assumptions about validity of pointer values. The problem with asserts is that they do not expose assumptions through the interface (e.g. in return types or parameters). Asserts are also harder to maintain and keep in sync with other code changes. The recommendation is to use gsl::not_null from the Guidelines Support Library as a marker of resources which should never have null value. The rule USE_NOTNULL helps to identify places that omit checks for nullness and hence can be updated to use gsl::not_null.
1818

0 commit comments

Comments
 (0)