Код: Выделить всё
#include
#include
#include
thread_local int val = 0;
class MyClass {
public:
MyClass() {
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79490145/why-doesnt-cause-every-thread-the-constructor-to-run-when-the-class-is-initiali[/url]
Мобильная версия