Singleton, alias to self?

Vladde Nordholm via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 14 04:56:51 PST 2016


I'm not sure of how to use alias efficiently, so I want to know 
if I could somehow do this (psuedo-code)

class Singleton
{
   //So instead of calling `Singleton.getSingleton()` you just 
call `Singleton`
   alias this = getSingleon()

   //code for singleton...
}

Thanks in advance,
vladde


More information about the Digitalmars-d-learn mailing list