Commit Graph

2140 Commits

Author SHA1 Message Date
Herb Sutter
13176c69de Revert adding short anchors, and keep fixes to avoid {{
`{{` interferes with rendering the page
2024-02-15 11:33:49 -10:00
Herb Sutter
acf08ddd46 Add #pNN anchors for P section 2024-02-15 09:54:18 -10:00
Jan Schultke
631eccd444
F.21 Don't return tuples (#2166)
* F.21 don't return tuples

* F.21 implement Herb's suggestions

* Mini-rebase for spell check fix

* elaborate on optional/expected

Co-authored-by: Jonathan Wakely <github@kayari.org>

* improve wording in one sentence

Co-authored-by: Jonathan Wakely <github@kayari.org>

* fix incorrect code transformation

Co-authored-by: Jonathan Wakely <github@kayari.org>

* fix missing word

---------

Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
Co-authored-by: Jonathan Wakely <github@kayari.org>
2024-01-25 12:27:47 -08:00
Herb Sutter
e784212ef0 Fix spell check regression 2024-01-22 12:38:07 -08:00
Sergey Zubkov
fcda019d0b fix CI 2024-01-22 15:19:26 -05:00
Herb Sutter
e44d35b55c Fix F.27 example, closes #2171 2024-01-18 16:38:45 -05:00
Jan Schultke
41426a1a5f
#1191 replace member variable with data member (#2087)
Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
2024-01-18 13:20:40 -08:00
Jan Schultke
85e2fa321f
fix missing forward for function object parameter (#2092) 2024-01-18 10:30:32 -08:00
1024
48d57dc6a2
added missing title to GSL.owner link (#2156) 2024-01-18 10:23:57 -08:00
Amir Livneh
0e5b13b543
Fix typos (#2158) 2024-01-18 10:21:43 -08:00
A. Jiang
0f1e36cf06
Use the term "default member initializer" (#2161)
without changing the anchor.
2024-01-18 10:20:49 -08:00
Niels Dekker
8789617b23
ES.87 (redundant == or !=) Fix dynamic_cast to Circle pointer (#2168)
The second ES.87 example seemed to mistakenly assume that `Circle` is pointer type, by the way it was using `dynamic_cast`. However, `Circle` is meant to be a class type instead. This fix is consistent with other examples, that also do `dynamic_cast<Circle*>`.
2024-01-08 23:51:31 -05:00
Sergey Zubkov
e49158aa7e update date 2023-10-12 17:04:18 -04:00
Sleep_AllDay
1bdb43e5c7
ES.30 fix example code (#2143)
* ES.30 fix example code 

The example should be passing in a constexpr and validating it at compile time like a macro, but instead passes a unknown value at compile time. Which may cause mislead and the code doesn't even work.

Ref: #2136

* Update CppCoreGuidelines.md

Used enums instead of raw numbers.
2023-10-12 17:02:51 -04:00
bgloyer
56e5b42eee
Con.1 Issue #1905 Return local const (#2114)
* Con.1 const return

* minor
2023-10-12 13:02:28 -07:00
Jan Schultke
e694c3cd04
Modernize uses of POD types (#2120)
* modernize uses of POD types

* update isocpp.dic
2023-10-12 12:55:10 -07:00
Kimi MA
77680bff2b
fix NL.9 ALL_CAPS does not apply to non-macro symbolic constants (#2130)
* fix NL.9 ALL_CAPS does not apply to non-macro symbolic constants

* Update CppCoreGuidelines.md

fix according to comment
2023-10-12 12:53:14 -07:00
Jan Schultke
9b9eeccf3a
NL.8: elaborate on reserved identifiers (#2131)
* NL.8: elaborate on reserved identifiers

* Update CppCoreGuidelines.md

* Update CppCoreGuidelines.md

* Update CppCoreGuidelines.md

---------

Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
2023-10-12 12:52:16 -07:00
Timm Knape
6d96d8e09d
I.30: use const c-string to pass filename and input string in example (#2140)
to signal that they will not modified
2023-10-12 12:42:27 -07:00
Timm Knape
4ad63d7d34
F.21 add loop increment in bad example (#2141)
to mimic the previous examples and avoid an infinite loop.
2023-10-12 12:41:49 -07:00
Nicolas van Kempen
b6363bbf11
Fix DeprecationWarning for cgi package (#2148) 2023-10-12 12:33:10 -07:00
apenn-msft
2a3690d1e3
Use portable header identifiers (#2149)
* SF.13  Use portable header identifiers in `#include` statements

add a new rule governing how to compose portable header path identifiers such that they respect proper casing (<vector>, not <VECTOR>) and portable path separators ('/')

* anchor

* fix typos

* fix warnings

* nit

* nit

* nit

* normalize on 'util'

* clean up wording

* Update CppCoreGuidelines.md

---------

Co-authored-by: Herb Sutter <herb.sutter@gmail.com>
2023-10-12 12:32:05 -07:00
Werner Henze
2d87c45e4b
ES.23: change example code to better match the rule (#2150)
The example suggests that `int z = gsl::narrow_cast<int>(7.9);;` is OK. The rule says "Use `=` only when you are sure that there can be no narrowing conversions.", which matches, but is also says "For built-in arithmetic types, use `=` only with `auto`.", and this is not respected here. So replace the one line with both possibilities suggested by the rule.

Co-authored-by: Werner Henze <w.henze@avm.de>
2023-10-12 12:25:52 -07:00
Werner Henze
a43285d95a
Make example code adhere to C.65 (#2151)
C.65 requires move assignment to be safe for self-assignment. The given example is not safe for self-assignment as given right now. This commit fixes this.

Co-authored-by: Werner Henze <w.henze@avm.de>
2023-10-12 12:23:59 -07:00
Raymond Chen
27e662bebb
ES.61 clarify wording (#2137)
The original text was "If the `new` and the `delete` are in the same scope, mistakes can be flagged." This has been [misinterpreted](https://stackoverflow.com/q/75905524) to mean "Any `new` and `delete` in the same scope is a mistake and should be flagged."

Reword the Enforcement clauses to follow the pattern established by the other Enforcement clauses: "Flag (bad thing)". Also, call the issue a "mismatch" rather than a "mistake", so that it is more clear that the underlying issue is the mismatch between scalar and array new/deletion.
2023-09-28 15:00:36 -07:00
Timm Knape
5eb1467d5e
I.12: use a const string as mentioned in the text 2023-09-18 13:40:08 -04:00
antcolag
b43874936f
ES.34: use the previously declared "const char * is" 2023-08-28 00:06:14 -04:00
bgloyer
b5adbd2564
F_3 void auto (#2125) 2023-08-17 22:04:37 -04:00
MikhailBerezhanov
7c9dd4dda8
dual hierarchy example: interface hierarchies fix (#2122)
Co-authored-by: Mikhail Berezhanov <mpb@martistel.com>
2023-08-14 10:45:43 -04:00
Xavier1113
e1b17ec9a5
C.181 Fix missing type specifier (#2117) 2023-08-07 14:06:08 -04:00
Xavier1113
f2485c56a1
Fix variable name in example (#2116) 2023-08-06 01:25:02 -04:00
Eisenwave
efbc482f0d
Fix missing noexcept specifiers (#2102) 2023-07-04 22:32:22 -04:00
Eisenwave
892b8ea7f3
fix stray inline link (#2104) 2023-06-24 23:45:30 -04:00
Eisenwave
fe3e83e648
fix memory leak in example of C.66 (#2096) 2023-06-24 23:40:24 -04:00
Eisenwave
b11fbd0195
replace "modulo arithmetic" with "modular arithmetic" (#2088) 2023-06-23 23:42:15 -04:00
Eisenwave
68f56f0a34
fix missing return *this (#2097) 2023-06-23 23:39:17 -04:00
Eisenwave
95aca76777
add spaces in requires expressions (#2098) 2023-06-23 23:38:55 -04:00
Eisenwave
a80c2a6f36
fix ill-formed example C.65 (missing noexcept on declaration) (#2101) 2023-06-23 23:34:42 -04:00
Eisenwave
db079ab301
fix stray ellipsis (#2091) 2023-06-23 13:08:51 -04:00
Chris Cotter
1634e898b6
C++20 is more up to date than C++17 (#2085) 2023-06-22 12:25:52 -04:00
Sergey Zubkov
c17b4be1e8 RF.rules: archive AUTOSAR pdf link (closes #2070) 2023-05-04 17:16:52 -04:00
Kimi MA
f3d1b34462
remove redundant "what to do" (#2075) 2023-04-29 22:20:04 -04:00
Fernando J. Iglesias García
16f29fd38c
Use enum class in Enum.4 example. (#2065) 2023-04-13 23:26:43 -04:00
Sergey Zubkov
1d04d93dbe bump date and make CI happy 2023-04-13 23:20:52 -04:00
Herb Sutter
1b41448298 List some non-enum alternatives to macros in Enum.1, closes #2054 2023-04-13 14:51:03 -07:00
Herb Sutter
89a20b2cc8 Expand comment about why P.3 'bad' code is unclear, closes #2058 2023-04-13 14:42:41 -07:00
Herb Sutter
3c90d590e1 Allow [&] capture default when also capturing this, closes #2060 2023-04-13 14:33:21 -07:00
bgloyer
0d70ae927d
SL_3 'Do not add non-standard entities to namespace std' add example (#2031)
* SL_3 add example

* Update isocpp.dic

add My_Vector
2023-03-30 14:18:53 -07:00
Henrique Mageste
6a0b5e6eca
Abstract class needs at least one abstract method to be considered abstract (#2053)
The introduction of the method is needed, for instance, for constructions like std::is_abstract<AbstractBase>::value to be evaluated to true
2023-03-30 14:17:31 -07:00
Herb Sutter
696633572c Remove spurious Enforcement, closes #2061 2023-03-30 14:14:19 -07:00