[Issue 3449] const and invariant struct members do not behave according to spec
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 24 00:51:05 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=3449
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at digitalmars.com
--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> 2011-11-24 00:50:02 PST ---
I believe the correct solution is to make const/immutable fields with
initializers into static members. Without initializers, they are per-instance
fields, and must be initialized by the constructor.
If the user wants manifest constants in a struct/class, use enum.
--
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