From 77f366acef64c389b43a77ebcd1c25e201d3e705 Mon Sep 17 00:00:00 2001 From: songqing Date: Thu, 3 Apr 2025 10:03:28 +0800 Subject: [PATCH] Fix compilation errors with C++17 feature --- util/env_posix.cc | 2 +- util/env_windows.cc | 2 +- util/no_destructor.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/env_posix.cc b/util/env_posix.cc index c2490322e..37f641eab 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -874,7 +874,7 @@ class SingletonEnv { #endif // !defined(NDEBUG) static_assert(sizeof(env_storage_) >= sizeof(EnvType), "env_storage_ will not fit the Env"); - static_assert(std::is_standard_layout_v>); + static_assert(std::is_standard_layout>::value); static_assert( offsetof(SingletonEnv, env_storage_) % alignof(EnvType) == 0, "env_storage_ does not meet the Env's alignment needs"); diff --git a/util/env_windows.cc b/util/env_windows.cc index ae5149a50..d9319fb4b 100644 --- a/util/env_windows.cc +++ b/util/env_windows.cc @@ -769,7 +769,7 @@ class SingletonEnv { #endif // !defined(NDEBUG) static_assert(sizeof(env_storage_) >= sizeof(EnvType), "env_storage_ will not fit the Env"); - static_assert(std::is_standard_layout_v>); + static_assert(std::is_standard_layout>::value); static_assert( offsetof(SingletonEnv, env_storage_) % alignof(EnvType) == 0, "env_storage_ does not meet the Env's alignment needs"); diff --git a/util/no_destructor.h b/util/no_destructor.h index c28a10731..edb576b20 100644 --- a/util/no_destructor.h +++ b/util/no_destructor.h @@ -21,7 +21,7 @@ class NoDestructor { explicit NoDestructor(ConstructorArgTypes&&... constructor_args) { static_assert(sizeof(instance_storage_) >= sizeof(InstanceType), "instance_storage_ is not large enough to hold the instance"); - static_assert(std::is_standard_layout_v>); + static_assert(std::is_standard_layout>::value); static_assert( offsetof(NoDestructor, instance_storage_) % alignof(InstanceType) == 0, "instance_storage_ does not meet the instance's alignment requirement");