simple-stdatomic-for-VS-Clang
simple-stdatomic-for-VS-Clang copied to clipboard
_Atomic keyword
Perhaps a naive question but in C11 there's the _Atomic keyword brought in with stdatomic.h.
This library does not cover that but how would one then declare an atomic pointer, ie:
_Atomic (void*) some_atomic_struct;
Good question. However, it is preferred to use atomic_intptr_t or atomic_uintptr_t instead of void*.
So if you wanna operate a pointer, just cast it to atomic_intptr_t. Maybe it is more general and portable. Afterall, C++11 does not contain _Atomic either. :)