Pluto Yang
cf3eacad1a
SL.io.50: missing backticks ( #1994 )
2022-11-17 10:51:17 -05:00
CFrei
016742b1c0
Fix typo in SL.C.1 link title ( #1991 )
2022-11-11 12:33:27 -05:00
Niels Dekker
bf29c35082
ES.24 (Use a unique_ptr) Example should delete the raw pointer ( #1986 )
...
Without having a `delete p2` statement at the end, the claim that "the object pointed to by `p2` is leaked" would just seem trivial.
2022-10-19 14:29:43 -04:00
Aditya Ardiya
5c1a2b69fb
Fix typo reference to pro-type-union ( #1985 )
...
clang-tidy has [cppcoreguidelines-pro-type-union-access](https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/pro-type-union-access.html ) that refers to the pro-type-union. Unfortunately there's an typo. This commit tries to fix the type
2022-10-18 09:22:50 -04:00
Niels Dekker
f4a9420e32
R.5 (scoped objects): Do not warn on a const unique_ptr<T[]> ( #1969 )
...
`unique_ptr<T[]>` is being used in practice to declare a local dynamically allocated buffer.
2022-10-13 14:08:53 -07:00
Niels Dekker
40ce5d12c3
R.5 (scoped objects): Remove auto from Enforcement section ( #1979 )
...
The enforcement rule on "an object is allocated and then deallocated on all paths" is not _specifically_ about objects declared by the `auto` keyword, and `auto` does not just mean "automatic storage duration" anymore.
2022-10-13 14:03:43 -07:00
saimen
8181873753
F.21: fix variable name in example and text ( #1981 )
2022-10-07 17:27:57 -04:00
Sergey Zubkov
65aae3ede6
C.65: clarify pointer move example with comments (issue #1892 )
2022-10-07 09:24:06 -04:00
Sergey Zubkov
0b22b82159
Revert "C.65: more explicit about the badness of bad example"
...
This reverts commit 7ad62600f1 .
2022-10-07 00:53:03 -04:00
Sergey Zubkov
bafb571ade
F.53 add notes about capture of this and non-local pointers
...
closes #1816
2022-10-06 19:17:44 -04:00
Sergey Zubkov
a217a9ff71
F.20 extract unrelated parts into new rule, F.49
...
closes #1862
2022-10-06 19:05:38 -04:00
Sergey Zubkov
7ad62600f1
C.65: more explicit about the badness of bad example
...
closes #1892
2022-10-06 18:57:40 -04:00
Herb Sutter
b22df66453
Closes #1907
2022-09-29 14:28:23 -07:00
Sergey Zubkov
c16373c838
bump date
2022-09-23 00:26:02 -04:00
Sergey Zubkov
5d2c6c9dd2
moved T.140/T.141 to F.10/F.11 leaving redirects behind ( closes #1974 )
2022-09-23 00:25:03 -04:00
Sergey Zubkov
083bca09d6
move SF.1 to NL.27, leaving a redirect behind ( closes #1965 )
2022-09-23 00:18:05 -04:00
Sergey Zubkov
f25df31132
[F.21] address returning expensive-to-copy tuples ( closes #1945 )
2022-09-23 00:04:32 -04:00
Sergey Zubkov
dfaecb2e75
[R.12] disambiguate identifier in examples ( closes #1960 )
2022-09-22 23:42:40 -04:00
Xeverous
71e48cf083
NR.4: fix typo (declaration => definition) ( #1967 )
2022-09-22 14:17:04 -07:00
Andrey Sikorin
af048a07b8
Change = to {} for default member initialization ( #1973 )
...
* Change = to {} for default member initialization
* Remove nullptr
2022-09-22 14:07:34 -07:00
Sergey Zubkov
e1735eaf89
recover link to multimethods paper, closes #1975
2022-09-20 09:05:46 -04:00
Andrey Sikorin
728ed7c65f
Fix Adobe and CERT links ( #1971 )
2022-09-13 11:15:12 -04:00
tocic
4ec7e81ecb
Fix typos ( #1970 )
2022-09-11 23:52:09 -04:00
Sergey Zubkov
9d28e32999
C.87: fix missing access specifiers ( closes #1957 )
2022-08-08 15:39:14 -04:00
Sergey Zubkov
9a95f97f44
C.168: switch example to op+ to avoid side tracking about defaults ( closes #1955 )
2022-08-08 15:19:42 -04:00
Sergey Zubkov
0a7d70851c
F.17: note about passing reference wrappers by value (issue #1948 )
2022-08-08 15:11:33 -04:00
Daniel Kříž
6476b15070
SF.5: prefer relative import to absolute one ( #1944 )
...
Signed-off-by: Daniel Kříž <Daniel.kriz@protonmail.com >
2022-08-08 09:10:57 -07:00
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 ".
2022-08-08 09:09:41 -07:00
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.
2022-08-08 09:08:45 -07:00
Baiyan Huang
444704f703
C.168 Fix code example ( #1954 )
2022-08-05 08:53:47 -04:00
Nikolay Panov
dca24a0379
T.21 Fix wrong return type ( #1942 )
...
Co-authored-by: Nikolay Panov <pn.interface@gmail.com >
2022-08-02 12:30:21 -04:00
bgloyer
6f27719b2b
C.64 Minor fix to make example compile ( #1939 )
2022-07-18 21:52:16 -04:00
Sergey Zubkov
4b8b2819b9
C.32: amend merged PR per call notes. It overlaps R.3 quite a bit
2022-07-13 14:19:39 -04:00
Sergey Zubkov
2b05a48a05
F.1 drop invalid line closes #1928
2022-07-13 12:36:52 -04:00
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 >
2022-07-13 09:23:14 -07:00
Ankur Satle
f2e9b5c2ac
Issue #1931 : C++20 wasn't included in "modern C++" ( #1932 )
...
* Issue #1931 - Include C++20 as 'modern C++'
* "modern C++" means C++11 and newer
2022-07-13 09:06:56 -07:00
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.
2022-07-13 09:05:36 -07:00
Sven van Haastregt
fde9ee5de1
C.9: Improve an inline link ( #1933 )
...
Avoid ending the sentence with a dangling "see".
2022-07-07 09:04:59 -04:00
Francisco Moretti
6d018fcf5f
C.166: Use markdown format and document title for link ( #1929 )
2022-06-25 14:53:25 -04:00
Niels Dekker
81dfb4814d
Fix GitHub Actions build warnings, Marker style should be * ( #1925 )
2022-06-15 10:01:28 -04:00
Herb Sutter
d5907d6dd5
Extended E.16 to include copy ctor for exception type, closes #1921
2022-06-13 13:14:54 -07:00
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.
2022-06-13 09:11:50 -07:00
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.
2022-06-13 09:09:54 -07:00
Markus Hofbauer
ddef6cdbae
Move F.60 to align with TOC ( #1914 )
2022-05-19 17:05:04 -04:00
Sergey Zubkov
e30543d06a
NL dropping parenthesized bit, per commit comment
2022-05-07 23:02:44 -04:00
Sergey Zubkov
697a78b4f4
NL: rules-> suggestsions ( closes #1906 )
2022-05-05 16:19:56 -04:00
Sergey Zubkov
dc8f95d608
F.46: add note regarding the return of main (see #1896 )
2022-04-07 16:54:17 -04:00
Sergey Zubkov
4a386f0a65
[SF.21] adjust per editors call
2022-04-07 16:21:10 -04:00
bgloyer
0db2b88c57
Added example for SF.21 ( #1890 )
...
* Example for SF.21
* Update isocpp.dic
* remove space
* revert isocpp.dic change
2022-04-07 13:20:49 -07:00
William So
d9d985a9f6
[C.148] Fix 1 anchor link ( #1904 )
2022-04-05 16:17:56 -04:00