From 0306e01233c26090ee6404e80e125cad36ebe694 Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Tue, 19 Nov 2019 15:41:56 -0800 Subject: [PATCH] Fixes for g++ 4.9.2 compatibility (#6053) Summary: Taken from merryChris in https://github.com/facebook/rocksdb/issues/6043 Stackoverflow ref on {{}} vs. {}: https://stackoverflow.com/questions/26947704/implicit-conversion-failure-from-initializer-list Note to reader: .clear() does not empty out an ostringstream, but .str("") suffices because we don't have to worry about clearing error flags. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6053 Test Plan: make check, manual run of filter_bench Differential Revision: D18602259 Pulled By: pdillinger fbshipit-source-id: f6190f83b8eab4e80e7c107348839edabe727841 --- db/compaction/compaction_iterator_test.cc | 2 +- util/filter_bench.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/compaction/compaction_iterator_test.cc b/db/compaction/compaction_iterator_test.cc index ddda79a4c..94f297961 100644 --- a/db/compaction/compaction_iterator_test.cc +++ b/db/compaction/compaction_iterator_test.cc @@ -184,7 +184,7 @@ class TestSnapshotChecker : public SnapshotChecker { public: explicit TestSnapshotChecker( SequenceNumber last_committed_sequence, - const std::unordered_map& snapshots = {}) + const std::unordered_map& snapshots = {{}}) : last_committed_sequence_(last_committed_sequence), snapshots_(snapshots) {} diff --git a/util/filter_bench.cc b/util/filter_bench.cc index 9dc2ed436..6ff496cb1 100644 --- a/util/filter_bench.cc +++ b/util/filter_bench.cc @@ -606,7 +606,7 @@ double FilterBench::RandomQueryTest(uint32_t inside_threshold, bool dry_run, } if (!dry_run) { - fp_rate_report_ = std::ostringstream(); + fp_rate_report_.str(""); uint64_t q = 0; uint64_t fp = 0; double worst_fp_rate = 0.0;