Код: Выделить всё
struct TestStruct
{
int b;
inline TestStruct(): b(0) {}
};
namespace
{
thread_local TestStruct testStruct = {};
}
inline void Check(TestStruct ts)
{
if(testStruct.b == 0)
{
testStruct = ts;
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79821858/unexpected-behavior-when-assigning-reading-thread-local-variable-in-anonymous-un[/url]
Мобильная версия