mirror of https://github.com/Icinga/icinga2.git
Fix: Make Dictionary::Add() return the new key.
This commit is contained in:
parent
ec1c95f9dd
commit
ace116c732
|
@ -76,9 +76,10 @@ public:
|
||||||
* Adds an unnamed value to the dictionary.
|
* Adds an unnamed value to the dictionary.
|
||||||
*
|
*
|
||||||
* @param value The value.
|
* @param value The value.
|
||||||
|
* @returns The key that was used to add the new item.
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void Add(const T& value)
|
string Add(const T& value)
|
||||||
{
|
{
|
||||||
Iterator it;
|
Iterator it;
|
||||||
string key;
|
string key;
|
||||||
|
@ -93,6 +94,7 @@ public:
|
||||||
} while (it != m_Data.end());
|
} while (it != m_Data.end());
|
||||||
|
|
||||||
Set(key, value);
|
Set(key, value);
|
||||||
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Contains(const string& key) const;
|
bool Contains(const string& key) const;
|
||||||
|
|
Loading…
Reference in New Issue