Testing some singleton implementations

Stanislav Blinov stanislav.blinov at gmail.com
Fri Jan 31 02:28:40 PST 2014


On Friday, 31 January 2014 at 10:26:50 UTC, Dejan Lekic wrote:
> I should have mentioned two things in my previous post.
>
> 1) There are no locks involved. No need, because the solution 
> relies on the fact that static member variables are guaranteed 
> to be created the first time they are accessed.

And they are thread-local :)

> 2) Note that we have constructor disabled. This is important 
> not to forget. ;)

What use would the const version have? You'd still need some way 
to access the instance, right? Cast away const?


More information about the Digitalmars-d mailing list