Commit Graph

1753 Commits (6a0b5e6ecac6afe21670ef4460efe019b60aa2a8)

Author SHA1 Message Date
tocic 4ec7e81ecb
Fix typos (#1970) 3 years ago
Sergey Zubkov 9d28e32999 C.87: fix missing access specifiers (closes #1957) 3 years ago
Sergey Zubkov 9a95f97f44 C.168: switch example to op+ to avoid side tracking about defaults (closes #1955) 3 years ago
Sergey Zubkov 0a7d70851c F.17: note about passing reference wrappers by value (issue #1948) 3 years ago
Daniel Kříž 6476b15070
SF.5: prefer relative import to absolute one (#1944)
Signed-off-by: Daniel Kříž <Daniel.kriz@protonmail.com>
3 years ago
Niels Dekker 1aafa24880
E.15 Clarify when a rethrow would slice to `std::exception` (#1949)
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".
3 years ago
Nikolay Panov be1722ad0c
[#1946] T.65 Fix two typos (#1956)
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.
3 years ago
Baiyan Huang 444704f703
C.168 Fix code example (#1954) 3 years ago
Nikolay Panov dca24a0379
T.21 Fix wrong return type (#1942)
Co-authored-by: Nikolay Panov <pn.interface@gmail.com>
3 years ago
bgloyer 6f27719b2b
C.64 Minor fix to make example compile (#1939) 4 years ago
Sergey Zubkov 4b8b2819b9 C.32: amend merged PR per call notes. It overlaps R.3 quite a bit 4 years ago
Sergey Zubkov 2b05a48a05 F.1 drop invalid line closes #1928 4 years ago
bgloyer cbf455407e
Clean up and add example for C.32 - raw pointers (#1909)
* 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>
4 years ago
Gábor Szeder 42c4cc6a75
E.19: clarify that `finally` is from the GSL (#1936)
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.
4 years ago
Sven van Haastregt fde9ee5de1
C.9: Improve an inline link (#1933)
Avoid ending the sentence with a dangling "see".
4 years ago
Francisco Moretti 6d018fcf5f
C.166: Use markdown format and document title for link (#1929) 4 years ago
Niels Dekker 81dfb4814d
Fix GitHub Actions build warnings, Marker style should be `*` (#1925) 4 years ago
Herb Sutter d5907d6dd5 Extended E.16 to include copy ctor for exception type, closes #1921 4 years ago
Niels Dekker 9ead2c44b4
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.
4 years ago
Niels Dekker a534f4a168
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.
4 years ago
Markus Hofbauer ddef6cdbae
Move F.60 to align with TOC (#1914) 4 years ago
Sergey Zubkov e30543d06a NL dropping parenthesized bit, per commit comment 4 years ago
Sergey Zubkov 697a78b4f4 NL: rules-> suggestsions (closes #1906) 4 years ago
Sergey Zubkov dc8f95d608 F.46: add note regarding the return of main (see #1896) 4 years ago
Sergey Zubkov 4a386f0a65 [SF.21] adjust per editors call 4 years ago
bgloyer 0db2b88c57
Added example for SF.21 (#1890)
* Example for SF.21

* Update isocpp.dic

* remove space

* revert isocpp.dic change
4 years ago
William So d9d985a9f6
[C.148] Fix 1 anchor link (#1904) 4 years ago
Sergey Zubkov 66bdbf1a90
modernizing concepts (#1883) 4 years ago
Werner Henze df6787f651
formatting typo (#1895)
Co-authored-by: Werner Henze <w.henze@avm.de>
4 years ago
Sandor DARGO afa6f73f1a
formatting: Updates to I.4 (#1891) 4 years ago
apenn-msft ead60212f3
conditionally unused parameters can be declared using maybe_unused attribute. (#1863)
* conditionally unused parameters can be declared using maybe_unused attribute.

* move to Notes and add example

* whitespace?

* ok got the whitespace

* adjust example
4 years ago
al-mission-2016 eb2f4d7756
code formating fix: +1 new line (#1888)
One more new line is necessary after the text "Return statements in a case label are also OK:" to make the code excerpt after it be formatted as code.
4 years ago
Sergey Zubkov e01a72ee93 make two more mentions of supported standards agree with the Abstract 4 years ago
bgloyer 43f2e34148
E.14 exception type examples for #1852 (#1857)
* E.14

* clean-up

* add final

* Added words to dictionary

* cleanup

* fix typo

* Update CppCoreGuidelines.md
4 years ago
Sergey Zubkov 369beb8a0c make other mentions of supported standards agree with the Abstract 4 years ago
Hyuk Myeong 1a57ff0226
Fixed typos (#1876) 4 years ago
Melroy van den Berg 5f393d53af
Promote C++20 (#1880)
The documentation still mentions C++17, while C++20 is already out for some time. So I updated the introduction paragraphs.
4 years ago
Sergey Zubkov 171fda3597 F.7: de-lowercase two lines 4 years ago
Ryan A. Pavlik ba12aca973
Fix broken cross-references. (#1878) 4 years ago
Sergey Zubkov 11cc4c4775 E.15: typo in title 4 years ago
Sergey Zubkov fdbaff2bf7 [CP.2] link CP.102 list of books and add Herlihy-Shavit
closes #1725
4 years ago
Sergey Zubkov ce5341b02d merge ES.74 into ES.6, leaving a redirect behind
closes #1858
4 years ago
Kevin Boyette dc6ea376c4
ES.48: fix wording in reasoning (#1859) 4 years ago
oleksandrkozlov b6d7ab64ad
C.130: drop a destructor in the D class (#1855)
To follow the Rule of Zero.
4 years ago
Sergey Zubkov 620cf6278e C.130: drop final from last commit per meeting notes 4 years ago
bgloyer 86a42c29fc
Update CppCoreGuidelines.md (#1851) 4 years ago
Sergey Zubkov 4a51d9f129 satisfy CI checks 4 years ago
bgloyer 6ed82c8b7b
ES.11 Issue #1763 (#1849)
* Update for Issue 1763

* add copy case

* Add 'DataRecord'
4 years ago
Herb Sutter 23350fd99f Updated E.15
Straggler edit
4 years ago
Herb Sutter d568d190f6 Generalized E.15, closes #1848
Extended guideline to throw by value rather than by pointer
4 years ago
stefanhige 740e71ecf8
C.147: Add missing example. (#1835) 4 years ago
Alexey Dmitriev 34c4b9f525
Update example in F20 (#1839)
Rewrite copy vs move example to actually involve copy/move as opposite to be copy elided
4 years ago
Alexey Dmitriev b35c837477
Replace structured bindings example in ES.11 (#1840)
Closes #1655
4 years ago
Herb Sutter 72b235041b Update C.183 to use `std::byte`, closes #1823 4 years ago
Herb Sutter 369a5be424 Made `char*` advice more consistent, closes #1826 4 years ago
Herb Sutter e44a9fcbd4 Add enforcement for C.35, closes #1831 4 years ago
bgloyer 596f1ee227
ES.46 Issue 1797 - narrowing to bool (#1824)
* ES.46 Issue 1797

* spacing

* remove spaces

* dereference ptr

* spacing

* used contextual conversions to bool wording
4 years ago
bgloyer 375d452495
R.34-35 shared_ptr examples (#1808) 4 years ago
David Machaj ddc8f3e7d6
Add CP.52 and CP.53 guidelines, closes #1805, closes #1806 (#1812)
* 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
4 years ago
ash 5bbf843942
T.61 example fixes (#1813) 5 years ago
Herb Sutter 786749e60c
Clarify "concrete type" and make type category descriptions consistent (closes #1780) (#1798)
* 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>
5 years ago
Sergey Zubkov 2feba4fbd3 make CI happier 5 years ago
Gustav Jansson 652a93ef46
[Pro.safety] Changed lettered list to a numbered (isocpp#1800) (#1801)
* Changed lettered list to a numbered (isocpp##1800)

* Added blank line for CI (isocpp##1800)
5 years ago
Sergey Zubkov bda7ff108f CI fixes 5 years ago
Herb Sutter 4c4fb37b43 Corrected enforcement of C.67 5 years ago
Herb Sutter 528cb9e832 Update C.67 and C.130 to address #1151 5 years ago
Herb Sutter 52e6263377 Add Tour2e example to C.126, closes #1794 5 years ago
Herb Sutter 402815345e Added suggestion to use a pointer member instead of a reference; closes #1783 5 years ago
Herb Sutter 03fc3a359b Closes #1791 5 years ago
Herb Sutter d93489f3d4 Applying Jonathan's suggestion for #1792 5 years ago
Alessandro Gentilini b96d861fd1
Add clarification at C.21 (#1792) 5 years ago
Marco Gartmann da97de7160
Rewrite C.164 enforcement (#1789)
Rewrite C.164 enforcement to flag non-explicit conversion operators only.
5 years ago
Juha Reunanen e2dbebed73
Do not allocate an excessive amount of memory in example code. (#1788)
This reverts commit de20b33dab.
5 years ago
Herb Sutter e583929996 Updated Con.1 to make one function a definition, closes #1785
Also fixed "arguments" -> "parameters"
5 years ago
peno2 bfa349b648
Remove 2 redundant else, according to rule F.56 (#1766)
* Remove 2 redundant else, according to rule F.56

* Remove continue from example code

Update after pull request comment.
5 years ago
5chmidti 211f6cfe3a
Fix C.127 example (#1775)
- fix for D being abstract but trying to create an object of type D in make_unique<D>()
5 years ago
Herb Sutter de20b33dab Restored `*sizeof(int)` after merging PR #1776 5 years ago
Juha Reunanen bf63aca389
A mixed bag of minor fixes, mostly related to language use (I mean English, not C++) (#1776)
* 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*
5 years ago
Bill Rose 8a0053d671
Update change_speed example in P.1 to use user-defined literal syntax (#1778)
Co-authored-by: Bill Rose <neptoess@gmail.com>
5 years ago
Kie 2541e809b6
[I.9] fix typo (#1787) 5 years ago
Juha Reunanen 58f91d7cf1
C.86: Improve language just a bit (#1774) 5 years ago
Juha Reunanen 52b0aa7cdf
C.other: Improve language just a bit (#1773) 5 years ago
Juha Reunanen b933a61940
C.31: Improve language just a bit (#1772) 5 years ago
Juha Reunanen c3baa7ce8b
C.66: Improve language just a bit (#1771) 5 years ago
Juha Reunanen 652b71b2c0
F.20: Improve language just a bit (#1768) 5 years ago
Juha Reunanen 402565d74e
F.52: Improve language just a bit (#1770) 5 years ago
Sergey Zubkov 077a29ee3c CI fixes 5 years ago
Herb Sutter 7849d7e7c4 Added F.56, closes #1752 5 years ago
Herb Sutter 77b4175785 Added C.12 to discourage `const`/reference data members
Would have been nice to put this after C.9 but item numbers are dense
around here.
5 years ago
Herb Sutter 4498e078e7 Refined spec for `narrow` to cover signedness promotions, closes #1726 5 years ago
Herb Sutter c8e72981c4 Fixed misapplied edit for `<=>` 5 years ago
Herb Sutter 4f6e11940e Added bad/good example for C.89, closes #1727 5 years ago
nullptr-cpp 8bdb8fe0dc
Add '<=>' to comparison operators related rules (C.87, C.167) (#1759)
* 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>
5 years ago
nullptr-cpp 5f75ea4b4b
C.63: Fix a minor typo (#1760)
In accordance with the title at line 4568, use `const&` instead of `const &`.
5 years ago
Sergey Zubkov 1dd82988d7 make CI happier 5 years ago
Herb Sutter 4f0659fb75 Added CP.coro and CP.51, closes #1756 5 years ago
Herb Sutter ccb7eff4ec CP.1: Made "bad" example consistent with now-updated "good" example 5 years ago
Martin ffeca2a254
Change comparison to use int instead of double (#1758)
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>
5 years ago
JuliusBrueggemann 1caef9a7f1 Use the same phrasing in index and actual rule 5 years ago
Herb Sutter c57e95d1c8 Clarify meaning of "inline" in F.5, closes #1731 5 years ago