Commit Graph

1979 Commits

Author SHA1 Message Date
Hugh Macdonald
d996c97809
Fix typo in SL.str.1 (#1648)
Part of SL.str.1 references replacing “const string*” with “string_view”, but the example code above shows “const string&” instead.
This changes the comment to the reference rather than pointer.
2020-07-14 11:41:23 -04:00
hsutter
12f29f2ea9 Closes #1647 2020-07-09 12:00:47 -07:00
Sergey Zubkov
895d709546 NR.5: note that example is incomplete (closes #1643) 2020-07-09 14:24:22 -04:00
al-mission-2016
c6262ea1a8
+= structured bindings mentioning; -= '\n' (#1646)
It worth to mention the *structured bindings* right in the *Reason* section.
2020-07-09 11:04:17 -07:00
Sergey Zubkov
72fba35f33 travis CI fix 2020-07-09 13:08:55 -04:00
hsutter
43bbde7fc9 Committing PR #1640 to main branch 2020-07-03 17:43:13 -07:00
Sergey Zubkov
ac7079b012 travis CI fix 2020-07-02 15:15:05 -04:00
Arthur O'Dwyer
567331ab4e
Const-qualify operator()s. NFC. (#1638)
As a general rule, `operator()` should be const-qualified.
The exceptions are few and far between.

I was actually looking for a Guideline on that subject;
I grepped for `operator()` and found that not only is there
no such Guideline yet, the doc actually contained these
places that (needlessly) violated the general rule.
2020-07-02 11:08:50 -07:00
Arthur O'Dwyer
c379d3f6ea
Remove a broken example, and copyedit. (#1637)
Using `this` in a free function makes the program ill-formed;
it doesn't magically give you a `std::thread*`.
2020-07-02 11:07:46 -07:00
Sergey Zubkov
45ad5c4628 C.49: fix typo in example (closes #1642) 2020-06-29 14:17:02 -04:00
Manlio Morini
2477f275dc
Fixed broken link (Res-nonnegative) (#1641) 2020-06-22 13:49:20 -04:00
Sergey Zubkov
8b94f6ee58 I.9: update outdated note that talks of 2018 as the future, closes #1525 2020-06-11 14:39:28 -04:00
Sergey Zubkov
62be4c856d ES.28: drop broken and unnecessary example, closes #1590 2020-06-11 14:35:31 -04:00
Anthony Cassidy
9efcaf07f7
Removed anti-CamelCase comments. (#1632)
The comments were:
// ???Must we suffer CaMelcAse???
and
// ugly CaMeLcAsEvArIaBlE
2020-06-04 11:19:47 -07:00
xtofl
4867a5c2d3
Use '<thing> template' i.s.o. 'template <thing>' (#1631)
* Use '<thing> template' i.s.o. 'template <thing>'

The word 'template' is often wrongly used as an adjective to the 'thing'
it becomes when instantiated.

* Expand succinct formulation for readability

Co-authored-by: Kristoffel Pirard <kristoffel.pirard@vanhool.com>
2020-06-04 11:18:37 -07:00
rico-chet
1936cb6b44
[NL.{11,15}] Bring rules in order (#1629)
The rules NL.11 (Make literals readable) and NL.15 (Use spaces
sparingly) are placed in inverted order in the text flow, swap them.
2020-06-02 15:23:14 -04:00
Sergey Zubkov
4625c984e9 bump date 2020-05-28 15:14:02 -04:00
Sergey Zubkov
24c3993e97 fix CI, fix heading and add comment requested at today's editor's call 2020-05-28 15:06:52 -04:00
Arthur O'Dwyer
d56d67969c
Expand CP.61 to talk about the general "factory" pattern. (#1621) 2020-05-28 15:04:34 -04:00
Arthur O'Dwyer
e8e0d103c0
CP.1: Simplify example, show good example, expand on rationale (#1615)
"Make your code thread-safe" usually means "don't use global state."
Advice to replace global state with `thread_local` state is usually misguided.
https://quuxplusone.github.io/blog/2018/11/14/fiber-local-storage/
2020-05-28 11:57:18 -07:00
Hyuk Myeong
19f2672b9e
Adjust the spacing for consistency (#1626)
* Adjust the spacing for consistency

* Adjust the spacing for consistency-2
2020-05-28 11:41:32 -07:00
rico-chet
9960c7dd7f
[SF.10] Fix annotation of the _bad_ example (#1627)
The _bad_ example wasn't annotated as such and a perfectly fine function
name was marked bad.

Annotate the example as bad and remove the misleading function name
annotation.
2020-05-28 11:37:50 -07:00
Moritz 'Morty' Strübe
f604a6b5d6
[F.36] Typo (missing s) (#1623) 2020-05-20 11:34:11 -04:00
Arthur O'Dwyer
6e0f8ace0b
Tweak one of ES.10's examples for verisimilitude. (#1611)
For some reason the trailing `e = 3` seemed more of a red flag
than anything else about this line. Let's imply that the programmer
is trying to make some constants for hexadecimal translation.
2020-05-14 11:43:48 -07:00
Dale Visser
46dadd0b16
Modified slightly impolite language (#1601)
* dumb -> inefficient
2020-05-07 11:28:14 -07:00
Yaro Shkvorets
97797870ad
code typo in R.20 (#1619) 2020-05-06 08:41:10 -04:00
apenn-msft
f4c80921d6
Update CppCoreGuidelines.md 2020-04-25 13:01:25 -07:00
apenn-msft
4e61010c27
keep wording more consistent
.... if a bit more monotonous, but that's ok.
2020-04-23 02:57:54 -07:00
apenn-msft
426ac8747d
updated wording around use of <> for projects
make it more clear that using <> for external projects is just a typical example (and not the only use case for <> outside of standard headers)
2020-04-22 12:30:50 -07:00
apenn-msft
bbc2f4dc5d
Merge branch 'master' into patch-1 2020-04-22 12:00:37 -07:00
Sergey Zubkov
986402298a travis CI fixes 2020-04-22 09:35:16 -04:00
Arthur O'Dwyer
d45496ff5e
You should never =delete a destructor! (#1605) 2020-04-20 08:59:37 -04:00
apenn-msft
30ef5b8524
update code markdown for #include 2020-04-03 14:19:18 -07:00
apenn-msft
66792e4875
Update wording and examples for SF.12: Prefer the quoted form of #include for files relative
Updated wording, adjusted example, and provided a more verbose example of what can go wrong if using the wrong form.
2020-04-03 13:01:07 -07:00
apenn-msft
e47463c14a
SF.12: Prefer the quoted form of #include for files relative to the including file
The current guidance on SF.12 can be over-applied and devolves into "always use <>" because all compilers support adding include directories to the <> search. In this case, even the current directory may be added and so it is always possible to use <> for every header. Applying the guidance then devolves into an undesirable state where <> is always used and include"" is never used.

Instead, the proposed guidance leverages and encourages the distinction between <> and "" to create an easy-to-understand rule that the original guidance hints at and that most developers already follow and understand: "" is for local headers and <> is for library and external headers.
2020-04-02 15:53:36 -07:00
Sergey Zubkov
9928c95f97 typos, wording, links (closes #1529) 2020-04-02 11:26:53 -04:00
hsutter
b4bb11a833 Tweak to close #1588 2020-03-26 11:47:45 -07:00
shaneasd
040b141acf
Clarify ES.48 enforcement rule for void cast of [[nodiscard]] (#1588) 2020-03-26 11:47:19 -07:00
hsutter
1ca5545ce1 Followup to close #1586 2020-03-26 11:43:27 -07:00
Akash Mozumdar
6f01c706a8
Actually detect negative sizes by following ES.106 (#1586)
* Actually detect negative sizes by following ES.106

And don't use senseless one letter names

* fix grammar

Co-Authored-By: Johel Ernesto Guerrero Peña <johelegp@gmail.com>

Co-authored-by: Johel Ernesto Guerrero Peña <johelegp@gmail.com>
2020-03-26 11:38:07 -07:00
Sylwester Fraczek
d2be4cba57
F.21 remove ; in function definition (#1592) 2020-03-24 12:22:45 -04:00
Sergey Zubkov
ab91388efd
fix mismatched anchors, closes #1569 (#1581) 2020-03-19 11:34:50 -07:00
Akash Mozumdar
aea393c85c
C.180 example bugfix (#1587)
new[] needs delete[]
2020-03-16 08:27:00 -04:00
Adnn
2f0c2e5874
C.22 Fixes a mistake in the code example not making a deep copy (#1573) 2020-02-27 20:18:08 +01:00
hsutter
fc383d6641 Updated #1570
Typo
2020-02-27 11:16:46 -08:00
Chris Guzak
63ceef65e3
Add SF.12, 3rd try (#1570)
* add SF.12

* add incscope to isocpp.dic to get the CI build to pass

* expand INCLUDES, update dictionary for the ci build to pass

* pr feedback

* in the same directory

* update based on feedback

* 3rd try

* PR feedback

* update lable

* Update CppCoreGuidelines.md

* Update CppCoreGuidelines.md
2020-02-27 20:16:10 +01:00
hsutter
6388b4d1ea Followup to PR 1564
Changed the two anchors back (anchors need to stay stable and don't
display visibly anyway)
Switched "non-public" back to hyphernated (to use hyphenation
consistently)
2020-02-27 11:14:04 -08:00
Hyuk Myeong
ab0255b371
Add and remove hyphens to words that begin with non (#1564)
* Add hyphens to words that begins with a non

* Remove hyphens in nonpublic
2020-02-27 20:10:24 +01:00
roroberto
1429d9ec71
Added example to CP.61: Use an async() to spawn a concurrent task (#1557)
Added example to CP.61: Use an async() to spawn a concurrent task
2020-01-30 14:45:04 -05:00
Herb Sutter
6e72adc0fe
Casting away const isn't undefined behavior, but modifying a constant is (#1509)
* Casting away const isn't undefined behavior, but modifying a constant is

You can cast away `const` as much as you like, as long as you never write to variable.

* rewording for clarification
2020-01-30 11:28:19 -08:00