Skip to content

Commit

Permalink
metrics: change push_back({...}) to emplace_back(...)
Browse files Browse the repository at this point in the history
Some compilers interpret {...} as an initializer list, probably due to
std::tuple's constructor (which is the value type) being explicit.

Changing to emplace_back() avoids the issue.

Fixes scylladb#275.
  • Loading branch information
avikivity committed Apr 6, 2017
1 parent 8be51eb commit 41fecdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ values_copy get_values() {
std::vector<std::tuple<shared_ptr<registered_metric>, metric_value>> values;
for (auto&& v : i.second) {
if (v.second.get() && v.second->is_enabled()) {
values.push_back({v.second, (*(v.second))()});
values.emplace_back(v.second, (*(v.second))());
}
}
if (values.size() > 0) {
Expand Down

0 comments on commit 41fecdd

Please sign in to comment.