Updated guidance on noexcept on destructors (#814)

This commit is contained in:
Neil MacIntosh 2017-03-20 11:44:13 -07:00 committed by GitHub
parent 38a6acc1c0
commit 33098ab31e

View File

@ -4573,7 +4573,7 @@ If a destructor uses operations that may fail, it can catch exceptions and in so
##### Enforcement ##### Enforcement
(Simple) A destructor should be declared `noexcept`. (Simple) A destructor should be declared `noexcept` if it could throw.
### <a name="Rc-dtor-noexcept"></a>C.37: Make destructors `noexcept` ### <a name="Rc-dtor-noexcept"></a>C.37: Make destructors `noexcept`
@ -4583,11 +4583,11 @@ If a destructor uses operations that may fail, it can catch exceptions and in so
##### Note ##### 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. 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. By explicitly marking destructors `noexcept`, an author guards against the destructor becoming implicitly `noexcept(false)` through the addition or modification of a class member.
##### Enforcement ##### Enforcement
(Simple) A destructor should be declared `noexcept`. (Simple) A destructor should be declared `noexcept` if it could throw.
## <a name="SS-ctor"></a>C.ctor: Constructors ## <a name="SS-ctor"></a>C.ctor: Constructors