__gshared and static constructors

Jacob Carlborg doob at me.com
Wed Jan 4 23:16:18 PST 2012

On 2012-01-04 20:14, Alex Rønne Petersen wrote:
> Hi,
> When using __gshared for variables at module level, it is my
> understanding that they should be initialized in the shared static this
> constructor. My question is: When having __gshared variables inside
> classes, where should I initialize these? Do classes have a shared
> static this constructor?
> - Alex

I don't think there's much difference between a module constructor and a 
static class constructor. I think that second is just scoped in the class.

/Jacob Carlborg

More information about the Digitalmars-d-learn mailing list