dmd 2.063 beta 5
Dicebot
m.strashun at gmail.com
Fri May 24 06:54:20 PDT 2013
On Friday, 24 May 2013 at 13:46:49 UTC, Steven Schveighoffer
wrote:
> This was ALWAYS the case.
>
> struct S
> {
> int x = 5; // sets S.init.x to 5
> }
>
As far as I understand Don, this behavior should be considered
misleading too, it does not matter if variable is const or not.
And that does have some sense, because you have initializer
syntax which does not really initialize anything on its own,
contrary to very same initializer syntax used with variable.
There is an option to prohibit initializers for struct member
declarations at all and allow CTFE-able default constructors
instead, but that would have been a major change.
It does not change the fact that old behavior was completely
broken beyond imagination though.
More information about the Digitalmars-d-announce
mailing list