[Issue 3789] [TDPL] Structs members that require non-bitwise comparison not correctly compared

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 24 13:58:47 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=3789



--- Comment #29 from bearophile_hugs at eml.cc 2013-04-24 13:58:44 PDT ---
(In reply to comment #28)

> So even if you've initialized all the variables in a struct, if don't first
> blit the struct itself, your struct will be in a globally "not fully
> initialized" state. From there, an opEqual may fails, which would be legitimate
> undefined behavior.

All D programmers need to keep this in account. The usage of
std.array.minimallyInitializedArray is one of such cases.

In D there is enough static introspection to statically tell if a struct has
holes or not. So you can use this information to tell when it's safer to use
uninitialized structs.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list