mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fixed code indentation, numbering and typo in Discussion: Destructors, deallocation, and swap must never fail
This commit is contained in:
parent
9aa9f290e2
commit
c827bddcd5
|
@ -12971,7 +12971,7 @@ Here, copying `s` could throw, and if that throws and if `n`'s destructor then a
|
|||
void test(string& s)
|
||||
{
|
||||
innocent_bystander i; // more trouble brewing
|
||||
string copy = s; // copy the string
|
||||
string copy2 = s; // copy the string
|
||||
} // destroy copy and then i
|
||||
|
||||
Here, if constructing `copy2` throws, we have the same problem because `i`'s destructor now also can throw, and if so we'll invoke `std::terminate`.
|
||||
|
|
Loading…
Reference in New Issue
Block a user