summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tag_compound.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tag_compound.cpp b/src/tag_compound.cpp
index af0d685826..5e9d81aaf7 100644
--- a/src/tag_compound.cpp
+++ b/src/tag_compound.cpp
@@ -37,6 +37,21 @@ value& tag_compound::operator[](const std::string& key)
return tags[key];
}
+bool tag_compound::put(const std::string& key, std::unique_ptr<tag>&& t)
+{
+ auto it = tags.find(key);
+ if(it != tags.end())
+ {
+ it->second = std::move(t);
+ return false;
+ }
+ else
+ {
+ tags.emplace(key, value(std::move(t)));
+ return true;
+ }
+}
+
bool tag_compound::erase(const std::string& key)
{
return tags.erase(key) != 0;