From f90b15dd7a5b8b832d8119c4bc02520eaae7ed5e Mon Sep 17 00:00:00 2001 From: Michael Park Date: Fri, 18 Dec 2015 15:37:25 +0000 Subject: [PATCH] C.37: Added a note about implicit declaration of `noexcept` for destructors. --- CppCoreGuidelines.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 6ca3d8b..c61f666 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -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. +##### 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 (Simple) A destructor should be declared `noexcept`.