leveldb
leveldb copied to clipboard
require c++17 instead of c++11
Fixes the following build issue on GCC v9:
In file included from leveldb/util/comparator.cc:14:
leveldb/./util/no_destructor.h: In constructor ‘leveldb::NoDestructor<InstanceType>::NoDestructor(ConstructorArgTypes&& ...)’:
leveldb/./util/no_destructor.h:24:24: error: ‘is_standard_layout_v’ is not a member of ‘std’; did you mean ‘is_standard_layout’?
24 | static_assert(std::is_standard_layout_v<NoDestructor<InstanceType>>);
| ^~~~~~~~~~~~~~~~~~~~
| is_standard_layout
leveldb/./util/no_destructor.h:24:70: error: expected primary-expression before ‘>’ token
24 | static_assert(std::is_standard_layout_v<NoDestructor<InstanceType>>);
| ^~
leveldb/./util/no_destructor.h:24:72: error: expected primary-expression before ‘)’ token
24 | static_assert(std::is_standard_layout_v<NoDestructor<InstanceType>>);
| ^
make[2]: *** [CMakeFiles/leveldb.dir/build.make:468: CMakeFiles/leveldb.dir/util/comparator.cc.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:183: CMakeFiles/leveldb.dir/all] Fehler 2
This is a C++17 feature.
Note: I won't sign Google CLA.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Since the google styleguide states "Currently, code should target C++20, i.e., should not use C++23 features" . Seems reasonable.
Had found the same regression as you in #1247
Is there anyone who can merge this request, or create a new PR? It's just a very minor fix.
It is better to make this compatible with C++11 by replacing the std::is_standard_layout_v part, as suggested in https://github.com/google/leveldb/pull/1251/commits/16c2b79d4d27a66b7e9da31117e01343e5b2d991.