* [P.6] trivial: s/f/f2/ (#2288)
A comment in a code example was intended to refer to a function named "f2",
but the comment uses the name "f" instead, presumably because the code was
copied from the previous example; this commit fixes the typo.
* [P.6] trivial: Move a code comment (//...) to the line above the code (#2288)
This matches the way the previous, related code example is written,
a fact you can observe more readily by reviewing the patch of this
commit with larger context:
git diff -U19
Specifically, the previous example looks like this:
// bad: the number of elements is not passed to f()
f(new int[n]);
* [P.6] trivial: s/a/the/ (#2288)
While "a wrong number can be passed" makes sense (and there are perhaps
good philosophical reasons to prefer it), I believe that the more natural
way to say it in common English is "the wrong number can be passed"; thus,
this commit changes "a" to "the" in the comment of a code example.
---------
Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
* C.183: Mention bit_cast as a C++20+ solution
* Remove last line
The change looks good, just removing the last line as it's more documentation than guidance
---------
Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
* final draft of proposal
* fix alloc formal
* resolve ambiguity and fix TODO
* some wording improvements
* apply some feedback after offline review w/ @GabrielDosReis
* Update specification after review from C++ Core Guidelines
- Make sure iterators and references cannot be invalidated by any
operations (besides destruction).
- Update specification to annotate that some functions require certain
language features (ranges and concepts).
- Remove dependence on "Container" named requirements because they
require iterator-invalidating behavior.
- Explicitly add default and move constructors.
- Fix some typos
* Update dyn_array documentation reflecting editors' feedback
Clarified that `gsl::dyn_array` cannot be moved or copied. Updated the FAQ section to emphasize that it is a fixed-size array without iterator/pointer-invalidating operations.
* Update FAQ regarding gsl::dyn_array usage
Clarified the purpose of gsl::dyn_array in the FAQ section.
---------
Co-authored-by: Gabriel Dos Reis <GabrielDosReis@users.noreply.github.com>
GitHub Flavored Markdown requires these anchors to be all-lowercase for
markdown-style links within the document to work.
Also change one anchor that uses '*' which isn't valid in HTML or
Markdown.
And rename duplicate anchor res-macros to res-macros3.
All the URLs changed here are to sites which do support HTTPS and which
automatically redirect the current links to the HTTPS version. Using
https:// directly avoids a redirection and a second request.
The only http:// URLs not fixed are broken and should be replaced in a
separate fix.
Under P.6, there are a few examples where the size is passed separately. The local variable name for the size is n. There is a typo and m is passed instead. There is no local var named m. It should be n.
the issue was raised that it can be interpreted as a claim that final
and override are the same; this attempts to make it harder to misread
closes#2235
Made NR.7 ("Don't make all data members `protected`") clearer by removing the word "all".
Used the default formulation of C.133 ("Avoid `protected` data") as hyperlink text, linking to C.133. Used the old hyperlink text ("Make member data `public` or (preferably) `private`") as alternative formulation of C.133.
Added missing periods in various parts of the text to ensure consistency and correctness in writing style. This revision maintains uniform formatting throughout the document, improves readability, and aligns the punctuation with the rest of the content for a more polished and structured appearance.