Skip to content
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

C++20 compatibility #6697

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
af91b57
Fix implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20
syoliver-se Mar 22, 2020
880549c
Allow to choose C++ version in cmake command line
syoliver-se Mar 22, 2020
4a1df6e
Fix deprecated copy warning in gcc 9
syoliver-se Apr 5, 2020
2756589
Minimal Rebuild is deprecated in visual studio since 2015 and is forb…
syoliver-se Apr 5, 2020
cea96d0
random_shuffle is deprecated in C++14 and removed in C++17
syoliver-se Apr 5, 2020
4e46260
Fix implicit this lambda capture deprecation
syoliver-se Apr 5, 2020
96f7359
Add implicit lambda capture in raw makefile
syoliver-se Apr 6, 2020
5962870
Add MSVC2019 to AppVeyor
syoliver-se Apr 6, 2020
d31e395
Add gcc-9 with c++11 and c++20 to travis
syoliver-se Apr 6, 2020
43eee91
Merge remote-tracking branch 'origin/master' into pr/6648
pdillinger Apr 10, 2020
87f3151
Reduce cmake variants built on each PR
pdillinger Apr 10, 2020
831fb29
Fix whitespace / noeol in CMakeLists.txt
pdillinger Apr 10, 2020
3de7ca9
Tweak so that no configuration change is needed
pdillinger Apr 10, 2020
c9e951e
Unified RandomShuffle
pdillinger Apr 13, 2020
756ea7f
Remove 'this' capture from folly import
pdillinger Apr 14, 2020
1b7b028
Remove an unnecessary capture spec
pdillinger Apr 14, 2020
dda5107
make format
pdillinger Apr 14, 2020
427a33d
Merge remote-tracking branch 'origin/master' into cxx20
pdillinger Apr 14, 2020
882a9d5
Fixup after merge
pdillinger Apr 14, 2020
c19c8ac
Better capture solution for Baton.h
pdillinger Apr 14, 2020
da5b61e
Actually, just use explicit capture
pdillinger Apr 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
random_shuffle is deprecated in C++14 and removed in C++17
  • Loading branch information
syoliver-se committed Apr 5, 2020
commit cea96d03b375de41135b5b8997b7c26448bc8472
6 changes: 4 additions & 2 deletions db/db_bloom_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "rocksdb/perf_context.h"
#include "table/block_based/filter_policy_internal.h"


namespace ROCKSDB_NAMESPACE {

namespace {
Expand Down Expand Up @@ -1343,8 +1344,9 @@ TEST_F(DBBloomFilterTest, OptimizeFiltersForHits) {
for (int i = 0; i < numkeys; i += 2) {
keys.push_back(i);
}
std::random_shuffle(std::begin(keys), std::end(keys));

std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);
int num_inserted = 0;
for (int key : keys) {
ASSERT_OK(Put(1, Key(key), "val"));
Expand Down
4 changes: 3 additions & 1 deletion db/db_compaction_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4762,7 +4762,9 @@ TEST_P(CompactionPriTest, Test) {
for (int i = 0; i < kNKeys; i++) {
keys[i] = i;
}
std::random_shuffle(std::begin(keys), std::end(keys));
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);

for (int i = 0; i < kNKeys; i++) {
ASSERT_OK(Put(Key(keys[i]), RandomString(&rnd, 102)));
Expand Down
4 changes: 3 additions & 1 deletion db/db_dynamic_level_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ TEST_F(DBTestDynamicLevel, DynamicLevelMaxBytesBase) {
keys[i] = i;
}
if (ordered_insert == 0) {
std::random_shuffle(std::begin(keys), std::end(keys));
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);
}
for (int max_background_compactions = 1; max_background_compactions < 4;
max_background_compactions += 2) {
Expand Down
12 changes: 9 additions & 3 deletions db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,9 @@ TEST_F(DBTest, ApproximateSizesMemTable) {
keys[i * 3 + 1] = i * 5 + 1;
keys[i * 3 + 2] = i * 5 + 2;
}
std::random_shuffle(std::begin(keys), std::end(keys));
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);

for (int i = 0; i < N * 3; i++) {
ASSERT_OK(Put(Key(keys[i] + 1000), RandomString(&rnd, 1024)));
Expand Down Expand Up @@ -4530,7 +4532,9 @@ TEST_F(DBTest, DynamicLevelCompressionPerLevel) {
for (int i = 0; i < kNKeys; i++) {
keys[i] = i;
}
std::random_shuffle(std::begin(keys), std::end(keys));
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);

Random rnd(301);
Options options;
Expand Down Expand Up @@ -4613,7 +4617,9 @@ TEST_F(DBTest, DynamicLevelCompressionPerLevel2) {
for (int i = 0; i < kNKeys; i++) {
keys[i] = i;
}
std::random_shuffle(std::begin(keys), std::end(keys));
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);

Random rnd(301);
Options options;
Expand Down
8 changes: 6 additions & 2 deletions db/perf_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ void ProfileQueries(bool enabled_time = false) {
}

if (FLAGS_random_key) {
std::random_shuffle(keys.begin(), keys.end());
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);
}
#ifndef NDEBUG
ThreadStatusUtil::TEST_SetStateDelay(ThreadStatus::STATE_MUTEX_WAIT, 1U);
Expand Down Expand Up @@ -524,7 +526,9 @@ TEST_F(PerfContextTest, SeekKeyComparison) {
}

if (FLAGS_random_key) {
std::random_shuffle(keys.begin(), keys.end());
std::random_device rng;
std::mt19937 urng(rng());
std::shuffle(std::begin(keys), std::end(keys), urng);
}

HistogramImpl hist_put_time;
Expand Down