4 ms·
Author here :-) (Didn't know anyone actually read my posts! I was surprised to find this on HN.) The only reason I didn't use std::atomic was because MSVC2010
by moodycamel 13y ago
Author here :-) (Didn't know anyone actually read my posts! I was surprised to find this on HN.)
The only reason I didn't use std::atomic was because MSVC2010 doesn't support it, and I wanted it to work in MSVC2010 (2012 adds std::atomic support though, if I remember correctly).
I agree that having a bunch of messy preprocessor-soup implementations of atomic primitives is really ugly and not very cross-platform friendly -- in the future I think I'll just stick to std::atomic.
atomicops.h does use std::atomic for all compilers except MSVC2010 and ICC13 (which only has partial std::atomic support).