AtomicStruct<T> provides atomic ops on small trivial classes
Summary:
AtomicStruct<T> acts like std::atomic<T>, but it supports any
trivial or trivially-copyable type up to 8 bytes in size. I'm not sure
why these types weren't included in the original std::atomic standard,
since this construct removes a lot of boilerplate for some uses of
std::atomic.
Test Plan:
1. unit tests
2. this code is adapted from production use in tao/queues/LifoSem
Reviewed By: davejwatson@fb.com
FB internal diff:
D1085106