May 16, 2017 D equivalent of C++11's function local static initialization? | ||||
|---|---|---|---|---|
| ||||
what's the best D equivalent of C++11's function local static initialization?
```
void fun(){
static auto a=[](){
//some code
return some_var;
}
}
```
(C++11 guarantees thread safety)
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply