1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

More utility methods

This commit is contained in:
Brian Fiete 2025-01-10 14:03:49 -08:00
parent 2f89450493
commit 35779edc14

View file

@ -117,12 +117,12 @@ public:
return *this; // At end
}
TKey GetKey()
TKey& GetKey()
{
return this->mDict->mEntries[this->mCurEntry].mKey;
}
TValue GetValue()
TValue& GetValue()
{
return this->mDict->mEntries[this->mCurEntry].mValue;
}
@ -468,6 +468,21 @@ public:
return end();
}
template <typename TKey>
bool Contains(const TKey& key)
{
return TryGet(key) != end();
}
template <typename TKey>
int GetCount(const TKey& key)
{
int count = 0;
for (auto itr = TryGet(key); itr != end(); ++itr)
count++;
return count;
}
template <typename TKey>
bool Remove(const TKey& key)
{