From 49ce5a019c5f8e4d862432734a42bc7aa2a18387 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Tue, 30 Jun 2015 17:45:50 +0200 Subject: Change interfaces of tag_compound and value once again --- src/tag_compound.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') 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&& 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; -- cgit 0.0.5-2-1-g0f52