2 ms·
See also N2660[1],a.k.a. "Dynamic Initialization and Destruction with Concurrency", a.k.a. C++ Magic Statics, for a similar feature built-in the language. The
by gpderetta 3y ago
See also N2660[1],a.k.a. "Dynamic Initialization and Destruction with Concurrency", a.k.a. C++ Magic Statics, for a similar feature built-in the language.
The paper has in the appendix a description of a possible implementation (which I believe is used by all major compilers).
[1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n26...
- memefrog 3y agoA similar feature built into a completely different language.
- gpderetta 3y agoC and C++ are hardly completely different. And C could adopt magic statics without any particular issue.
- memefrog 3y agoJava and JavaScript are more closely related than C and C++ today. They are completely different.
- gpderetta 3y agoAside for sharing a memory model (concurrent and whatnot), the vast majority of C++ specific constructs have a straightforward if not trivial mapping to C. C and C++ are very similar in all the aspects that count.