mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-18 13:14:40 +03:00
@@ -12008,7 +12008,7 @@ I got
|
|||||||
|
|
||||||
3.29048e-321 666 666
|
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
|
##### Note
|
||||||
|
|
||||||
@@ -20768,6 +20768,10 @@ Splitting initialization into two leads to weaker invariants,
|
|||||||
more complicated code (having to deal with semi-constructed objects),
|
more complicated code (having to deal with semi-constructed objects),
|
||||||
and errors (when we didn't deal correctly with semi-constructed objects consistently).
|
and errors (when we didn't deal correctly with semi-constructed objects consistently).
|
||||||
|
|
||||||
|
##### Note
|
||||||
|
|
||||||
|
Sometimes also called two-stage construction.
|
||||||
|
|
||||||
##### Example, bad
|
##### Example, bad
|
||||||
|
|
||||||
// Old conventional style: many problems
|
// Old conventional style: many problems
|
||||||
|
|||||||
Reference in New Issue
Block a user