diff options
| author | ljfa-ag <ljfa-ag@web.de> | 2015-07-09 18:09:06 +0200 |
|---|---|---|
| committer | ljfa-ag <ljfa-ag@web.de> | 2015-07-09 18:09:06 +0200 |
| commit | 4945e533c37d261e82d34ea129f441be06385cce (patch) | |
| tree | a8c36c3f35a524f54c2964616722bed1934b3763 /include | |
| parent | ea71042f79738bcdc08fe3bfa0a2f9cd1c0c03ac (diff) | |
| download | Project-Tick-4945e533c37d261e82d34ea129f441be06385cce.tar.gz Project-Tick-4945e533c37d261e82d34ea129f441be06385cce.zip | |
Create tag_compound::insert method
Diffstat (limited to 'include')
| -rw-r--r-- | include/tag_compound.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/tag_compound.h b/include/tag_compound.h index 80be2f609e..0789bed295 100644 --- a/include/tag_compound.h +++ b/include/tag_compound.h @@ -73,10 +73,18 @@ public: std::pair<iterator, bool> put(const std::string& key, value&& val); /** + * @brief Inserts a tag if the key does not exist + * @return a pair of the iterator to the value with the key and a bool + * indicating whether the value was actually inserted + */ + std::pair<iterator, bool> insert(const std::string& key, value&& val); + + /** * @brief Constructs and assigns or inserts a tag into the compound * * Constructs a new tag of type @c T with the given args and inserts * or assigns it to the given key. + * @note Unlike std::map::emplace, this will overwrite existing values * @return a pair of the iterator to the value and a bool indicating * whether the key did not exist */ |
