Updated Con.1 to make one function a definition, closes #1785

Also fixed "arguments" -> "parameters"
This commit is contained in:
Herb Sutter
2021-05-13 11:48:20 -07:00
parent bfa349b648
commit e583929996

View File

@@ -16540,13 +16540,13 @@ Prevents accidental or hard-to-notice change of value.
##### Exception ##### Exception
Function arguments are rarely mutated, but also rarely declared const. Function parameters passed by value are rarely mutated, but also rarely declared `const`.
To avoid confusion and lots of false positives, don't enforce this rule for function arguments. To avoid confusion and lots of false positives, don't enforce this rule for function parameters.
void f(const char* const p); // pedantic void f(const char* const p); // pedantic
void g(const int i); // pedantic void g(const int i) { ... } // pedantic
Note that function parameter is a local variable so changes to it are local. Note that a function parameter is a local variable so changes to it are local.
##### Enforcement ##### Enforcement