Initialising global associative array

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 6 11:43:28 PDT 2015


On 2015-06-06 20:18, Paul wrote:
> I need a globally accessible AA of type string[string] and find that it
> won't compile unless I use the static this(){} method as described in
> this thread:
>
> http://forum.dlang.org/thread/owhfdwrpfuiehzpiuqux@forum.dlang.org#post-mailman.1522.1346449072.31962.digitalmars-d-learn:40puremagic.com
>
>
> I understand the concept of this() insofar as returning a reference to
> an object but what is 'this' in the context referred to? A reference to
> the module??

"static this" is a module constructor. It's run before the "main" 
function is run.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list