[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 18:55:09 PDT 2012


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



--- Comment #16 from David Piepgrass <qwertie256 at gmail.com> 2012-07-25 18:55:01 PDT ---
> How would the programmer suppress this warning because it's deliberate?

When I wrote that, I was thinking that the developer can initialize in the
constructor if he really wants it to be non-static. But now I remember that
structs can't have a default constructor.

Personally I think coders should be able to suppress warnings inside a pragma.
But I think I heard Walter doesn't like that. Nevertheless it could easily be a
mistake to use "const int Foo = 7;" instead of "enum" or "static const int",
and the developer usually won't find out about the mistake without a warning.

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