top | item 37058805

(no title)

knocte | 2 years ago

LOL! The second S.O. link actually goes to show how broken C++ is: https://stackoverflow.com/a/18298965/544947

discuss

order

nullc|2 years ago

That's really a C related comment and all it doing is subbing in implementation specific pre-standard versions for the benefit of compatibility with compilers prior to the introduction of the feature in the C11 standard.

The standard calls it "_Thread_local", pre-standard MSVC/icc(win)/borland called it __declspec(thread), and pre-standard GCC/icc(linux)/clang/sun called it __thread.

Code would also be free to just use _Thread_local and say that a C11 conforming compiler is required.