From 177b50eced164097a3494343350c379cbca513fd Mon Sep 17 00:00:00 2001 From: Herb Sutter Date: Tue, 15 Apr 2025 11:02:42 -0700 Subject: [PATCH] Add notes, closes #2266, closes #2267 --- CppCoreGuidelines.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 523bd67..8b3c2b0 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -12008,7 +12008,7 @@ I got 3.29048e-321 666 666 -Surprised? I'm just glad I didn't crash the program. +Surprised? It is actually undefined behavior, and so could also have crashed the program. ##### Note @@ -20768,6 +20768,10 @@ Splitting initialization into two leads to weaker invariants, more complicated code (having to deal with semi-constructed objects), and errors (when we didn't deal correctly with semi-constructed objects consistently). +##### Note + +Sometimes also called two-stage construction. + ##### Example, bad // Old conventional style: many problems