Allow constexpr construction of AtomicStruct under MSVC
authorChristopher Dykes <cdykes@fb.com>
Sat, 4 Jun 2016 00:43:42 +0000 (17:43 -0700)
committerFacebook Github Bot 4 <facebook-github-bot-4-bot@fb.com>
Sat, 4 Jun 2016 00:53:51 +0000 (17:53 -0700)
commit58d507c161c5e8b097796fe5fb05ccc73c564d5c
treebc1ae3a74348829868fe39c9e15187fd237473e5
parent5911efa17496b5f4645955e143c3c0db40d1f9cc
Allow constexpr construction of AtomicStruct under MSVC

Summary: Attempting to use this under MSVC, as `MemoryIdler::defaultIdleTimeout` does, generated warnings about the symbol being dynamically initialized due to an implementation limation. Solve this by defining a union instead of calling `encode` in the constructor.

Reviewed By: yfeldblum

Differential Revision: D3387916

fbshipit-source-id: b0d628b6d086960e94121b6183a31348fb151aac
folly/AtomicStruct.h