any tool to at least partially convert C++ to D (htod for source

Max Samukha spambox at d-coding.com
Wed Mar 10 12:56:52 PST 2010


On 10.03.2010 21:28, Walter Bright wrote:
>
> template Foo()
> {
> static int _a;
> static int a()
> {
> static bool _a_inited;
> if (!_a_inited)
> { _a_inited = true;
> _a = 42;
> }
> return _a;
> }
> }

Lazy initialization requires some kind of synchronization when a is 
shared. Static initialization does not have that drawback.



More information about the Digitalmars-d mailing list