Can we drop static struct initializers?

Walter Bright newshound1 at digitalmars.com
Fri Nov 20 16:58:24 PST 2009


Bill Baxter wrote:
> On Fri, Nov 20, 2009 at 4:05 PM, Walter Bright
> <newshound1 at digitalmars.com> wrote:
>> Bill Baxter wrote:
>>> Right, but if you do define it (in order to do something extra upon
>>> initialization -- validate inputs or what have you) then it no longer
>>> works at compile time.
>> Right, but the static initialization then shouldn't work, either.
> 
> Why not?  It works if you use static opCall(int,int) instead of this(int,int).

Because if you need runtime execution to initialize, a back door to 
statically initialize it looks like a bug.



More information about the Digitalmars-d mailing list