Open Methods: From C++ to D

Jean-Louis Leroy via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Aug 30 11:20:46 PDT 2017


On Wednesday, 30 August 2017 at 18:05:38 UTC, jmh530 wrote:
> On Wednesday, 30 August 2017 at 17:24:55 UTC, Jean-Louis Leroy 
> wrote:
>>
>> We had a discussion about automating the call to updateMethods 
>> but I don't think that anybody thought of putting it in 
>> registerMethods. It might work. I'll look into it. Thanks for 
>> the suggestion...
>
> Ali had suggested something similar[1]. I think your concern 
> was that it would get called multiple times, but shared static 
> module constructors runs once a program (static module 
> constructor runs once per thread).
>
> [1] http://forum.dlang.org/post/okljj1$ktb$1@digitalmars.com

Ah yes...So the problem is that registerMethods emits static 
ctors that fill data structures representing the methods and the 
specializations. They have to run - all of them - before 
updateMethods. Thus, sadly Q's suggestion won't work.


More information about the Digitalmars-d-announce mailing list