From: Gunnar Beutner Date: Thu, 12 Jul 2012 08:24:54 +0000 (+0200) Subject: Fix: Make Dictionary::Add() return the new key. X-Git-Tag: v0.0.1~261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ace116c73288b965f979ed6eb9410d2cb2d906aa;p=icinga2 Fix: Make Dictionary::Add() return the new key. --- diff --git a/base/dictionary.h b/base/dictionary.h index d6c7f490f..28736d013 100644 --- a/base/dictionary.h +++ b/base/dictionary.h @@ -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 - 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;