Uses shared_ptr on variable names

This commit is contained in:
Felipe Zimmerle
2017-08-24 18:18:55 -03:00
parent 9d062f53a7
commit 003a8e8e5f
10 changed files with 38 additions and 46 deletions

View File

@@ -44,7 +44,7 @@ bool RulesExceptions::loadUpdateTargetByTag(const std::string &tag,
std::string *error) {
for (auto &i : *var) {
m_variable_update_target_by_tag.emplace(std::pair<std::string, std::unique_ptr<Variables::Variable>>(tag, std::move(i)));
m_variable_update_target_by_tag.emplace(std::pair<std::shared_ptr<std::string>, std::unique_ptr<Variables::Variable>>(std::make_shared<std::string>(tag), std::move(i)));
}
return true;
@@ -164,7 +164,7 @@ bool RulesExceptions::merge(RulesExceptions& from) {
}
for (auto &p : from.m_variable_update_target_by_tag) {
m_variable_update_target_by_tag.emplace(std::pair<std::string, std::unique_ptr<Variables::Variable>>(p.first, std::move(p.second)));
m_variable_update_target_by_tag.emplace(std::pair<std::shared_ptr<std::string>, std::unique_ptr<Variables::Variable>>(p.first, std::move(p.second)));
}
for (auto &p : from.m_variable_update_target_by_id) {