Blog Post #0105: D-specific Stuff for GUI Programming

Ron Tarrant rontarrant at gmail.com
Mon Mar 23 19:48:35 UTC 2020


On Monday, 23 March 2020 at 10:45:24 UTC, Jacob Carlborg wrote:
> On Monday, 23 March 2020 at 10:41:43 UTC, Jacob Carlborg wrote:
>
>> class DSingleton
>> {
>>     immutable DSingleton instance = new DSingleton;
>> }
>
> Should of course be `static`:
>
> class DSingleton
> {
>     static immutable DSingleton instance = new DSingleton;
> }
>
> --
> /Jacob Carlborg

Cool. Thanks, Jacob.

I can't take credit for the Singleton code, though. I stole it 
from here: https://wiki.dlang.org/Low-Lock_Singleton_Pattern



More information about the Digitalmars-d-announce mailing list