Apply edits to close #1984 #2004 #2006

Also removing some stray trailing whitespace on a few unrelated lines
This commit is contained in:
Herb Sutter
2022-12-08 14:03:45 -08:00
parent ee368e238e
commit b435cf54a5

View File

@@ -7466,7 +7466,7 @@ Problems:
and all classes derived from `Shape` and all code using `Shape` will need to be reviewed, possibly changed, and probably recompiled. and all classes derived from `Shape` and all code using `Shape` will need to be reviewed, possibly changed, and probably recompiled.
The implementation of `Shape::move()` is an example of implementation inheritance: The implementation of `Shape::move()` is an example of implementation inheritance:
we have defined `move()` once and for all for all derived classes. we have defined `move()` once and for all, for all derived classes.
The more code there is in such base class member function implementations and the more data is shared by placing it in the base, The more code there is in such base class member function implementations and the more data is shared by placing it in the base,
the more benefits we gain - and the less stable the hierarchy is. the more benefits we gain - and the less stable the hierarchy is.
@@ -9566,7 +9566,7 @@ Instead, use a local variable:
##### Enforcement ##### Enforcement
* (Moderate) Warn if an object is allocated and then deallocated on all paths within a function. Suggest it should be a local stack object instead. * (Moderate) Warn if an object is allocated and then deallocated on all paths within a function. Suggest it should be a local stack object instead.
* (Simple) Warn if a local `Unique_pointer` or `Shared_pointer` is not moved, copied, reassigned or `reset` before its lifetime ends. * (Simple) Warn if a local `Unique_pointer` or `Shared_pointer` that is not moved, copied, reassigned or `reset` before its lifetime ends is not declared `const`.
Exception: Do not produce such a warning on a local `Unique_pointer` to an unbounded array. (See below.) Exception: Do not produce such a warning on a local `Unique_pointer` to an unbounded array. (See below.)
##### Exception ##### Exception
@@ -21169,6 +21169,8 @@ Eventually, use [the one voted into C++17](http://www.open-std.org/jtc1/sc22/wg2
Some of the GSL types listed below might not be supported in the library you use due to technical reasons such as limitations in the current versions of C++. Some of the GSL types listed below might not be supported in the library you use due to technical reasons such as limitations in the current versions of C++.
Therefore, please consult your GSL documentation to find out more. Therefore, please consult your GSL documentation to find out more.
For each GSL type below we state an invariant for that type. That invariant holds as long as user code only changes the state of a GSL object using the types provided member/free functions (i.e., user code does not bypass the types interface to change the objects value/bits by violating any other Guidelines rule).
Summary of GSL components: Summary of GSL components:
* [GSL.view: Views](#SS-views) * [GSL.view: Views](#SS-views)