mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
style issues
This commit is contained in:
@@ -3142,10 +3142,10 @@ Here on one popular implementation I got the output:
|
|||||||
|
|
||||||
I expected that because the call of `g()` reuses the stack space abandoned by the call of `f()` so `*p` refers to the space now occupied by `gx`.
|
I expected that because the call of `g()` reuses the stack space abandoned by the call of `f()` so `*p` refers to the space now occupied by `gx`.
|
||||||
|
|
||||||
Imagine what would happen if `fx` and `gx` were of different types.
|
* Imagine what would happen if `fx` and `gx` were of different types.
|
||||||
Imagine what would happen if `fx` or `gx` was a type with an invariant.
|
* Imagine what would happen if `fx` or `gx` was a type with an invariant.
|
||||||
Imagine what would happen if more that dangling pointer was passed around among a larger set of functions.
|
* Imagine what would happen if more that dangling pointer was passed around among a larger set of functions.
|
||||||
Imagine what a cracker could do with that dangling pointer.
|
* Imagine what a cracker could do with that dangling pointer.
|
||||||
|
|
||||||
Fortunately, most (all?) modern compilers catch and warn against this simple case.
|
Fortunately, most (all?) modern compilers catch and warn against this simple case.
|
||||||
|
|
||||||
@@ -12069,7 +12069,7 @@ A `thread` that has not been `detach()`ed when it is destroyed terminates the pr
|
|||||||
|
|
||||||
##### Enforcement
|
##### Enforcement
|
||||||
|
|
||||||
* Flag `join's for `raii_thread`s ???
|
* Flag `join`s for `raii_thread`s ???
|
||||||
* Flag `detach`s for `detached_thread`s
|
* Flag `detach`s for `detached_thread`s
|
||||||
|
|
||||||
|
|
||||||
@@ -15762,7 +15762,7 @@ Use `!=` instead of `<` to compare iterators; `!=` works for more objects becaus
|
|||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
Of course, range-for is better still where it does what you want.
|
Of course, range-`for` is better still where it does what you want.
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
@@ -16409,7 +16409,7 @@ This slowdown can be significant compared to `printf`-style output.
|
|||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
cout << "Hello, World!" << endl; // two output operations and a flush
|
cout << "Hello, World!" << endl; // two output operations and a flush
|
||||||
cout << "hello, World!\n"; // one output operation and no flush
|
cout << "Hello, World!\n"; // one output operation and no flush
|
||||||
|
|
||||||
##### Note
|
##### Note
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user