Sujet : Re: Pre-main construction order in modules
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.c++Date : 31. Mar 2025, 10:11:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsdm8c$3sq3u$1@raubtier-asyl.eternal-september.org>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
Am 31.03.2025 um 10:56 schrieb Paavo Helde:
Before C++11 one had to just add their own synchronization for thread safety (assuming multi-threaded access was needed, which was not so often in the past).
C++11 just made coding of a Meyer's singleton easier, that's all.
That's not that easy since it is undefined when a static local variable
is initialized before C++11. You'd have to wrap it in a union and leave
only member which is the object uninitialized. That's possible, but
that's not Meyer's singleton.