Commit 14c2b1dc authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

fix a static-assert for C++20

Summary:
In C++20, `std::atomic` is no longer trivial. Change the static-assert that checks for its triviality to check instead for narrower properties.

Fixes: https://github.com/facebook/folly/issues/1594.

Reviewed By: ot, Mizuchi, luciang

Differential Revision: D28856931

fbshipit-source-id: e7ff4a1e80e59fdc78efb271f63c6325d5528416
parent d7389fcf
......@@ -206,7 +206,9 @@ class AccessSpreaderBase {
std::atomic<Getcpu::Func> getcpu; // nullptr -> not initialized
};
static_assert(
std::is_trivial<GlobalState>::value || kCpplibVer, "not trivial");
is_constexpr_default_constructible_v<GlobalState> &&
std::is_trivially_destructible<GlobalState>::value,
"unsuitable for global state");
/// Always claims to be on CPU zero, node zero
static int degenerateGetcpu(unsigned* cpu, unsigned* node, void*);
......
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