From 4b1f9ad99c503571298f95303120a96a4e7f5604 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Wed, 30 Sep 2015 20:30:37 +0200 Subject: [PATCH] fix missing closing parens (in test()) --- CppCoreGuidelines.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 8e4e443..d434dbc 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -11715,6 +11715,7 @@ static nefarious n; // oops, any destructor exception can't be caught ``` void test() { std::array arr; // this line can std::terminate(!) +} ``` The behavior of arrays is undefined in the presence of destructors that throw because there is no reasonable rollback behavior that could ever be devised. Just think: What code can the compiler generate for constructing an `arr` where, if the fourth object's constructor throws, the code has to give up and in its cleanup mode tries to call the destructors of the already-constructed objects... and one or more of those destructors throws? There is no satisfactory answer.