mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
travis CI fixes and grammar fix from #920
This commit is contained in:
@@ -13495,7 +13495,7 @@ Example with thread-safe static local variables of C++11.
|
|||||||
|
|
||||||
Double-checked locking is easy to mess up. If you really need to write your own double-checked locking, in spite of the rules [CP.110: Do not write your own double-checked locking for initialization](#Rconc-double) and [CP.100: Don't use lock-free programming unless you absolutely have to](#Rconc-lockfree), then do it in a conventional pattern.
|
Double-checked locking is easy to mess up. If you really need to write your own double-checked locking, in spite of the rules [CP.110: Do not write your own double-checked locking for initialization](#Rconc-double) and [CP.100: Don't use lock-free programming unless you absolutely have to](#Rconc-lockfree), then do it in a conventional pattern.
|
||||||
|
|
||||||
The uses of double-checked locking pattern that are not in violation of [CP.110: Do not write your own double-checked locking for initialization](#Rconc-double) arise when a non-thread-safe action is both hard and rare, and there exists a fast thread-safe test that can be used to guarantees that the action is not needed, but cannot be used to guarantee the converse.
|
The uses of the double-checked locking pattern that are not in violation of [CP.110: Do not write your own double-checked locking for initialization](#Rconc-double) arise when a non-thread-safe action is both hard and rare, and there exists a fast thread-safe test that can be used to guarantee that the action is not needed, but cannot be used to guarantee the converse.
|
||||||
|
|
||||||
##### Example, bad
|
##### Example, bad
|
||||||
|
|
||||||
@@ -14719,7 +14719,7 @@ For example, here is a `Date` that caches (mnemonizes) its string representation
|
|||||||
// ...
|
// ...
|
||||||
const string& string_ref() const
|
const string& string_ref() const
|
||||||
{
|
{
|
||||||
if (string_val=="") compute_string_rep();
|
if (string_val == "") compute_string_rep();
|
||||||
return string_val;
|
return string_val;
|
||||||
}
|
}
|
||||||
// ...
|
// ...
|
||||||
@@ -17351,7 +17351,7 @@ Flag `.h` files without `#include` guards.
|
|||||||
Some implementations offer vendor extensions like `#pragma once` as alternative to include guards.
|
Some implementations offer vendor extensions like `#pragma once` as alternative to include guards.
|
||||||
It is not standard and it is not portable. It injects the hosting machine's filesystem semantics
|
It is not standard and it is not portable. It injects the hosting machine's filesystem semantics
|
||||||
into your program, in addition to locking you down to a vendor.
|
into your program, in addition to locking you down to a vendor.
|
||||||
Our recommendation is to write in ISO C++: See [rule P.2]((#Rp-Cplusplus).
|
Our recommendation is to write in ISO C++: See [rule P.2](#Rp-Cplusplus).
|
||||||
|
|
||||||
### <a name="Rs-cycles"></a>SF.9: Avoid cyclic dependencies among source files
|
### <a name="Rs-cycles"></a>SF.9: Avoid cyclic dependencies among source files
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ fib10
|
|||||||
file1
|
file1
|
||||||
file2
|
file2
|
||||||
file3
|
file3
|
||||||
|
filesystem
|
||||||
flag1
|
flag1
|
||||||
fmt
|
fmt
|
||||||
fn
|
fn
|
||||||
@@ -289,6 +290,7 @@ microbenchmarks
|
|||||||
middleware
|
middleware
|
||||||
mixin
|
mixin
|
||||||
mixins
|
mixins
|
||||||
|
mnemonizes
|
||||||
modify1
|
modify1
|
||||||
modify2
|
modify2
|
||||||
moredata
|
moredata
|
||||||
@@ -367,6 +369,7 @@ PortHandle
|
|||||||
PostInitialize
|
PostInitialize
|
||||||
pp216
|
pp216
|
||||||
PPP
|
PPP
|
||||||
|
pragma
|
||||||
pre
|
pre
|
||||||
Pre
|
Pre
|
||||||
precomputation
|
precomputation
|
||||||
|
|||||||
Reference in New Issue
Block a user