diff --git a/toml/value.hpp b/toml/value.hpp index 739f676..a7f1f59 100644 --- a/toml/value.hpp +++ b/toml/value.hpp @@ -474,7 +474,7 @@ class value region_info_(std::make_shared(region_base{})) { array ary; ary.reserve(list.size()); - for(auto& elem : list) {ary.emplace_back(std::move(elem));} + for(const auto& elem : list) {ary.emplace_back(elem);} assigner(this->array_, std::move(ary)); } template::value, @@ -486,7 +486,7 @@ class value this->region_info_ = std::make_shared(region_base{}); array ary; ary.reserve(list.size()); - for(auto& elem : list) {ary.emplace_back(std::move(elem));} + for(const auto& elem : list) {ary.emplace_back(elem);} assigner(this->array_, std::move(ary)); return *this; }