From 0d70ae927dc28849a9600b531a8d7046bb0ef6ce Mon Sep 17 00:00:00 2001 From: bgloyer <36457894+bgloyer@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:18:53 -0700 Subject: [PATCH] SL_3 'Do not add non-standard entities to namespace `std`' add example (#2031) * SL_3 add example * Update isocpp.dic add My_Vector --- CppCoreGuidelines.md | 12 +++++++++++- scripts/hunspell/isocpp.dic | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 7332146..3be01b8 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -19754,7 +19754,17 @@ Additions to `std` might clash with future versions of the standard. ##### Example - ??? + namespace std { // BAD: violates standard + class My_vector { + // . . . + }; + } + + namespace Foo { // GOOD: user namespace is allowed + class My_vector { + // . . . + }; + } ##### Enforcement diff --git a/scripts/hunspell/isocpp.dic b/scripts/hunspell/isocpp.dic index 1b582cb..2e6796f 100644 --- a/scripts/hunspell/isocpp.dic +++ b/scripts/hunspell/isocpp.dic @@ -347,6 +347,7 @@ Murray93 mutex mutexes mx +My_vector MyCustomError MyException myMap