Like this.
struct some_struct { // Other fields ..... __thread int tl; }
I\'m trying to do that but the compiler is giving me this error
Write this way:
template struct S { thread_local static int tlm; }; template <> thread_local int S::tlm = 0; // "static" does not appear here
as stated in https://en.cppreference.com/w/cpp/language/storage_duration