mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Ambiguous indentation within unordered list
This commit is contained in:
parent
1e49b7b7a3
commit
90b62edaf0
|
@ -12362,18 +12362,20 @@ Aternatively, we will decide that no change is needed and delete the entry.
|
||||||
* What to do with leaks out of temporaries? : `p = (s1+s2).c_str();`
|
* What to do with leaks out of temporaries? : `p = (s1+s2).c_str();`
|
||||||
* pointer/iterator invalidation leading to dangling pointers
|
* pointer/iterator invalidation leading to dangling pointers
|
||||||
|
|
||||||
void bad()
|
Example:
|
||||||
{
|
|
||||||
int* p = new int[700];
|
|
||||||
int* q = &p[7];
|
|
||||||
delete p;
|
|
||||||
|
|
||||||
vector<int> v(700);
|
void bad()
|
||||||
int* q2 = &v[7];
|
{
|
||||||
v.resize(900);
|
int* p = new int[700];
|
||||||
|
int* q = &p[7];
|
||||||
|
delete p;
|
||||||
|
|
||||||
// ... use q and q2 ...
|
vector<int> v(700);
|
||||||
}
|
int* q2 = &v[7];
|
||||||
|
v.resize(900);
|
||||||
|
|
||||||
|
// ... use q and q2 ...
|
||||||
|
}
|
||||||
|
|
||||||
* LSP
|
* LSP
|
||||||
* private inheritance vs/and membership
|
* private inheritance vs/and membership
|
||||||
|
|
Loading…
Reference in New Issue
Block a user