[Issue 3449] const and invariant struct members do not behave according to spec

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 25 13:42:40 PDT 2012


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


David Piepgrass <qwertie256 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qwertie256 at gmail.com


--- Comment #14 from David Piepgrass <qwertie256 at gmail.com> 2012-07-25 13:42:36 PDT ---
+1 from me. Implicit static and (worse) implicit enum are bad ideas, and the
worst part is that whether it's static or not depends on whether there is an
initializer or not. (admittedly I am left wondering what the difference is
between "const int" and "immutable int", is it relevant?)

However, as a compromise, perhaps if the user writes "const int x = 7;" the
compiler could warn: "warning: since x is a constant, it should be declared
with static or enum to avoid wasting memory."

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