mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Merge pull request #469 from mpark/C.37
C.37: Added a note about implicit declaration of `noexcept` for destructors
This commit is contained in:
commit
b1f33a48a2
|
@ -3873,6 +3873,10 @@ If a destructor uses operations that may fail, it can catch exceptions and in so
|
||||||
|
|
||||||
[A destructor may not fail](#Rc-dtor-fail). If a destructor tries to exit with an exception, it's a bad design error and the program had better terminate.
|
[A destructor may not fail](#Rc-dtor-fail). If a destructor tries to exit with an exception, it's a bad design error and the program had better terminate.
|
||||||
|
|
||||||
|
##### Note
|
||||||
|
|
||||||
|
A destructor (either user-defined or compiler-generated) is implicitly declared `noexcept` (independently of what code is in its body) if all of the members of its class have `noexcept` destructors.
|
||||||
|
|
||||||
##### Enforcement
|
##### Enforcement
|
||||||
|
|
||||||
(Simple) A destructor should be declared `noexcept`.
|
(Simple) A destructor should be declared `noexcept`.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user