Avoided a potential misunderstanding that `throw e` would slice *any* `e` to `std::exception`.
The note about rethrowing appears to be written when the example of this item still did `catch (const exception& e)`, which was prior to commit d568d190f6, "Generalized E.15, closes #1848".
Fixes#1946:
- copy_trait type argument needs to be a container element type.
Use Value_type<Iter> like in other examples.
- Fix name typo in the definition of copy_helper.
* Update CppCoreGuidelines.md
* Update CppCoreGuidelines.md
* Update isocpp.dic
* use snake casing
* sake case naming
* C 32 comments (#3)
* F.16 ("in" parameters): Move Matrix example to F.20 (return values) (#1922)
The `Matrix` example and the notes about assignment appear off-topic in rule F.16, as F.16 is specifically about "in" parameters.
With help from Sergey Zubkov.
* SL.io.50 (Avoid `endl`): Mention string streams (#1920)
Explicitly mentioned string streams as `endl` insertions into string streams do actually occur in the wild.
With help from Sergey Zubkov.
* Extended E.16 to include copy ctor for exception type, closes#1921
* Fix GitHub Actions build warnings, Marker style should be `*` (#1925)
* restored reference
* Added references to note
Co-authored-by: Niels Dekker <N.Dekker@lumc.nl>
Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
Co-authored-by: Niels Dekker <N.Dekker@lumc.nl>
Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
When I stumbled upon E.19 "Use a `final_action` object to express
cleanup if no suitable resource handle is available" I was hopeful
that this `final_action`/`finally()` thing is from the STL, but, alas,
it isn't.
Make it clear that `finally` is a GSL construct.
The `Matrix` example and the notes about assignment appear off-topic in rule F.16, as F.16 is specifically about "in" parameters.
With help from Sergey Zubkov.
* conditionally unused parameters can be declared using maybe_unused attribute.
* move to Notes and add example
* whitespace?
* ok got the whitespace
* adjust example
* Add CP.52 and CP.53 guidelines
* Address some feedback on CP.52
* Fix PR break caused by code line longer than 100 characters in CP.53
* Fix spelling error and one line of trailing whitespace
* Tweaks to CP.53 based on feedback
* Clarify "concrete type" and make type category descriptions consistent (closes#1780)
* markdown fixup
Co-authored-by: Jonathan Wakely <cxx@kayari.org>
* Elaborated that we can't generally add comparison operators to C structs
Co-authored-by: Sergey Zubkov <cubbi@cubbi.com>
Co-authored-by: Jonathan Wakely <cxx@kayari.org>
* Minor comment fix
* Minor language fix
* Minor language fix
* Minor clarification
* Minor language fix
* Minor language fix
* Remove whitespace for clarity
* Make whitespace consistent (again, it wasn't the "bad" here, right?)
* Minor language fix
* Change weird formatting for emphasis
* Fix (what I believe is) a slightly distracting typo
* Minor language fix
* Suggest to highlight even security vulnerabilities as a possible outcome of concurrency errors
* Minor language fix
* Suggest to add new section for a seemingly unrelated note
* Minor language fix
* Minor language fix (not sure what this intended to say in the first place?)
* Minor language fix
* Add minor remark
* Minor language improvement
* Minor language fix
* Point out a bad example
* Minor fixes
* Minor language fix
* Add missing period (the lack of which doesn't look bad here, but does a bit in the rendered html)
* Minor language fix
* Minor language fix
* Minor typo fix (but is this what was meant?)
* Minor language improvement (?)
* Minor language fix
* Minor language fix (?)
* Add missing closing quotation mark
* Minor language fix
* Minor language fix
* Remove extra dot (or was it supposed to be three dots instead?)
* Minor language fix
* Minor language fix
* Minor language fix
* Minor language fix
* Minor language improvement
* Minor formatting improvements
* Minor improvements
* Minor language fix
* More fixing
* Add missing parentheses (did I get it right?)
* Minor language fix (?)
* Minor language fix
* Minor language fix
* Fix language (but is this what was meant in the first place?)
* Update heading to match content (in particular, the example)
* Remove superfluous whitespace
* Update also the "bad" example to use int*
* Add '<=>' to comparison operators related rules (C.87, C.167)
C++20's three-way comparison operator should respect the same rules as other
comparison operators.
* Fix a minor typo
Co-authored-by: Jonathan Wakely <github@kayari.org>
Co-authored-by: Jonathan Wakely <github@kayari.org>
This allows the example to remain simple well not misleading a beginner
such a comparison is safe. Including an epsilon comparison or something
similar would overly complicate this example.
Co-authored-by: Martin O'Shea <martin.oshea@native-instruments.com>