betterC shared static ctor

Steven Schveighoffer schveiguy at gmail.com
Wed Jul 21 14:00:49 UTC 2021


On 7/21/21 5:07 AM, vit wrote:

> Thanks, it works, but now I have different problem.
> I need call static method for all instantions of template struct from 
> `crt_constructor`.
> Is there way to iterate over all instantions of template?

Not unless you register them somehow upon instantiation.

Or (I think) you can implement the constructor as a static method, and 
tag it with `pragma(crt_constructor)`. Then it gets added when instantiated.

-Steve


More information about the Digitalmars-d-learn mailing list