Cyclic depency with class static ctor
Walter Bright
newshound at digitalmars.com
Sun Oct 29 20:48:55 PST 2006
BCS wrote:
> Walter Bright wrote:
>>
>> Yes. It isn't possible for the language to really determine the
>> dependencies, so it plays it safe and tries to get all the static
>> ctors run before the module(s) static ctors that import them. With
>> cyclic imports and static ctors in those cycles, this is not possible.
>
> If the rules were changed so that static this functions may only depend
> on modules imported before them, then a lot of cases could be made to work.
I'd rather have fewer order dependencies, not more <g>.
More information about the Digitalmars-d
mailing list