From: Yueh-Hsuan Chiang Date: Mon, 18 May 2015 20:44:31 +0000 (-0700) Subject: Fixed compile errors due to some gcc does not have std::map::emplace X-Git-Tag: rocksdb-3.11~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=74f3832d85e932ed485a4f8d8c01b0adc6b3e502;p=rocksdb.git Fixed compile errors due to some gcc does not have std::map::emplace Summary: Fixed the following compile errors due to some gcc does not have std::map::emplace util/thread_status_impl.cc: In static member function ‘static std::map, long unsigned int> rocksdb::ThreadStatus::InterpretOperationProperties(rocksdb::ThreadStatus::OperationType, const uint64_t*)’: util/thread_status_impl.cc:88:20: error: ‘class std::map, long unsigned int>’ has no member named ‘emplace’ util/thread_status_impl.cc:90:20: error: ‘class std::map, long unsigned int>’ has no member named ‘emplace’ util/thread_status_impl.cc:94:20: error: ‘class std::map, long unsigned int>’ has no member named ‘emplace’ util/thread_status_impl.cc:96:20: error: ‘class std::map, long unsigned int>’ has no member named ‘emplace’ util/thread_status_impl.cc:98:20: error: ‘class std::map, long unsigned int>’ has no member named ‘emplace’ util/thread_status_impl.cc:101:20: error: ‘class std::map, long unsigned int>’ has no member named ‘emplace’ make: *** [util/thread_status_impl.o] Error 1 Test Plan: make db_bench Reviewers: igor Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D38643 --- diff --git a/util/thread_status_impl.cc b/util/thread_status_impl.cc index 6c72160b9..bd3cf8267 100644 --- a/util/thread_status_impl.cc +++ b/util/thread_status_impl.cc @@ -97,21 +97,21 @@ std::map for (int i = 0; i < num_properties; ++i) { if (op_type == OP_COMPACTION && i == COMPACTION_INPUT_OUTPUT_LEVEL) { - property_map.emplace( - "BaseInputLevel", op_properties[i] >> 32); - property_map.emplace( - "OutputLevel", op_properties[i] % (1LU << 32)); + property_map.insert( + {"BaseInputLevel", op_properties[i] >> 32}); + property_map.insert( + {"OutputLevel", op_properties[i] % (1LU << 32)}); } else if (op_type == OP_COMPACTION && i == COMPACTION_PROP_FLAGS) { - property_map.emplace( - "IsManual", ((op_properties[i] & 2) >> 1)); - property_map.emplace( - "IsDeletion", ((op_properties[i] & 4) >> 2)); - property_map.emplace( - "IsTrivialMove", ((op_properties[i] & 8) >> 3)); + property_map.insert( + {"IsManual", ((op_properties[i] & 2) >> 1)}); + property_map.insert( + {"IsDeletion", ((op_properties[i] & 4) >> 2)}); + property_map.insert( + {"IsTrivialMove", ((op_properties[i] & 8) >> 3)}); } else { - property_map.emplace( - GetOperationPropertyName(op_type, i), op_properties[i]); + property_map.insert( + {GetOperationPropertyName(op_type, i), op_properties[i]}); } } return property_map;