Skip to content

Fix compilation errors with C++17 feature #1260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

songqing
Copy link

@songqing songqing commented Apr 3, 2025

Compilation errors with C++17 feature "std::is_standard_layout_v", as the default CMAKE_CXX_STANDARD is C++11, we can change to a compatible implementation.
Related issue #1247 and PR #1246

@l0rinc
Copy link

l0rinc commented Apr 3, 2025

Or change to C++17 or C++20 instead, like other PRs have done

@@ -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<SingletonEnv<EnvType>>);
static_assert(std::is_standard_layout<SingletonEnv<EnvType>>::value);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You likely need the message as well to be C++11 compatible

Suggested change
static_assert(std::is_standard_layout<SingletonEnv<EnvType>>::value);
static_assert(std::is_standard_layout<SingletonEnv<EnvType>>::value,
"SingletonEnv<EnvType> is not standard layout");

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, haven't seen it before, close this now.

@songqing
Copy link
Author

songqing commented Apr 3, 2025

Or change to C++17 or C++20 instead, like other PRs have done

Not all applications using LevelDB support C++17 or higher I think

@songqing songqing closed this Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants