Singleton Pattern with struct

Ali Çehreli acehreli at yahoo.com
Thu Jan 24 09:39:07 PST 2013


On 01/24/2013 09:35 AM, ParticlePeter wrote:

 > I'm fine with returning and using a pointer, fortunately there is no
 > difference in syntax as in c, so it doesn't matter.

With the exception that the -> operator is replaced by the dot operator 
in D:

     MyStruct * p = /* ... */;

     // Dot, not ->
     p.foo();
     p.i = 42;

Ali



More information about the Digitalmars-d-learn mailing list