non-constant expression
Jarrett Billingsley
kb3ctd2 at yahoo.com
Wed Jan 24 16:22:15 PST 2007
"Frits van Bommel" <fvbommel at REMwOVExCAPSs.nl> wrote in message
news:ep7qcc$1vrq$1 at digitaldaemon.com...
> Jarrett Billingsley wrote:
>> It looks weird, declaring a as a const and then assigning it in the
>> static this(), but that's perfectly legal -- you can assign to constant
>> values once, but that assignment can happen anywhere.
>
> I'm pretty sure you can only assign it in the appropriate constructor:
> static member --> static this() as member of same class/struct/whatever
> non-static member --> this() [other parameter lists also allowed]
> module-scope --> static this() at module scope
Yeah, that's right.
More information about the Digitalmars-d-learn
mailing list