Commit 1813a644 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Gate hazptr static_assert on _CPPLIB_VER vs _MSC_VER

Summary:
[Folly] Gate `hazptr` `static_assert` on `_CPPLIB_VER` vs `_MSC_VER`.

It's a property of the standard library implementation, not a property of the compiler front-end.

Reviewed By: smeenai, Orvid

Differential Revision: D7378222

fbshipit-source-id: 78d04252df751b683c0099cb0c273302ff388b73
parent 7d625d63
......@@ -363,6 +363,14 @@ constexpr auto kIsGlib49 = true;
#else
constexpr auto kIsGlib49 = false;
#endif
// cpplib is an implementation of the standard library, and is the one typically
// used with the msvc compiler
#if _CPPLIB_VER
constexpr auto kCpplibVer = _CPPLIB_VER;
#else
constexpr auto kCpplibVer = 0;
#endif
} // namespace folly
// Define FOLLY_USE_CPP14_CONSTEXPR to be true if the compiler's C++14
......
......@@ -315,7 +315,7 @@ class hazptr_priv {
};
static_assert(
folly::kMscVer || std::is_trivial<hazptr_priv>::value,
folly::kCpplibVer || std::is_trivial<hazptr_priv>::value,
"hazptr_priv must be trivial to avoid a branch to check initialization");
void hazptr_priv_init(hazptr_priv& priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment