* Update C.83 with swap for resource mgmt.
The swap is useful to implement assignments idiomatically (e.g. copy-swap idiom).
With the current enforcement, to non-virtual classes, very simple classes (e.g. `trivially_copyable`, a struct encapsulating an stl container) are suggested to have a swap. This suggestion can be argued wrong since for very simple classes copy-swap idiom is not efficient (the creation of a third object on assignment is not needed, which copy-swap does).
* Rework C.83 according to PR comments.
The various guidelines now have consistent Enforcements.
All C-style casts are now consistently banned, including to `(void)`.
Cast to `(void`)` should be `std::ignore =` instead.
All functional-style casts are now consistently banned, instead of
`T(x)` use `T{x}`.
In English, the word "may" is overloaded and ambiguous. This commit
changes it to "might" wherever possible, otherwise more specific
meanings like "can," "could," or especially "must" ("may not" -> "must
not" when that is intended).
The examples in SF.12 are likely to encourage readers to always use the `""` form of `'#include` when including headers from the same project ([discussion](https://github.com/isocpp/CppCoreGuidelines/pull/1596#issuecomment-673266275)). However, in larger projects this may not always be appropriate; `<>` should be used for includes located via a header search path.
This proposed solution adds an example of the later, i.e. where `<>` is used to include a header from the same project.
- Add a cross-reference to C.139 and note that it doesn't matter whether
a function is declared with override or final if the whole class is
already final.
- Fix C.139 to make it clearer that it's about `final` on classes.
explicitly note that "file" refers to as it exists in the location of it being authored/modified.
this is to address any confusion about #including "bar.h" from foo.h based on whether bar.h is relative to foo.h at the time and location foo.h is being modified (e.g. under mylib/foo.h) versus at the time/location from which foo.h is installed to the system and included by the user (e.g. from /usr/include).
Part of SL.str.1 references replacing “const string*” with “string_view”, but the example code above shows “const string&” instead.
This changes the comment to the reference rather than pointer.
As a general rule, `operator()` should be const-qualified.
The exceptions are few and far between.
I was actually looking for a Guideline on that subject;
I grepped for `operator()` and found that not only is there
no such Guideline yet, the doc actually contained these
places that (needlessly) violated the general rule.