Skip to content

Commit 0db2b88

Browse files
authored
Added example for SF.21 (isocpp#1890)
* Example for SF.21 * Update isocpp.dic * remove space * revert isocpp.dic change
1 parent d9d985a commit 0db2b88

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

CppCoreGuidelines.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19558,7 +19558,26 @@ It is almost always a bug to mention an unnamed namespace in a header file.
1955819558

1955919559
##### Example
1956019560

19561-
???
19561+
// file foo.h:
19562+
namespace
19563+
{
19564+
const double x = 1.234; // bad
19565+
19566+
double foo(double y) // bad
19567+
{
19568+
return y + x;
19569+
}
19570+
}
19571+
19572+
namespace Foo
19573+
{
19574+
inline constexpr double x = 1.234; // good
19575+
19576+
inline double foo(double y) // good
19577+
{
19578+
return y + x;
19579+
}
19580+
}
1956219581

1956319582
##### Enforcement
1956419583

0 commit comments

Comments
 (0)