]> granicus.if.org Git - icinga2/commitdiff
Fix: Make Dictionary::Add() return the new key.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Jul 2012 08:24:54 +0000 (10:24 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Jul 2012 08:24:54 +0000 (10:24 +0200)
base/dictionary.h

index d6c7f490f36eb6a3b42f068be636f3f5c21fccac..28736d01371eba0e47085de2d5422ad0cb607c8b 100644 (file)
@@ -76,9 +76,10 @@ public:
         * Adds an unnamed value to the dictionary.
         *
         * @param value The value.
+        * @returns The key that was used to add the new item.
         */
        template<typename T>
-       void Add(const T& value)
+       string Add(const T& value)
        {
                Iterator it;
                string key;
@@ -93,6 +94,7 @@ public:
                } while (it != m_Data.end());
 
                Set(key, value);
+               return key;
        }
 
        bool Contains(const string& key) const;