[Issue 11331] Inefficient initialization of struct with members = void

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 23 10:07:15 PDT 2013


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



--- Comment #4 from Andrei Alexandrescu <andrei at erdani.com> 2013-10-23 10:07:14 PDT ---
http://dlang.org/struct.html mentions that "Struct instances that are not
instantiated with a constructor are default initialized to their .init value."
and mentions that S() is "same as auto b = S.init;"

There is no guarantee about the values of the = void members in S.init, but
definitely the spec clarifies that two default-constructed objects will compare
equal. So we need to change the spec to only guarantee non-=void fields of
default-constructed objects to be equal.

-- 
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