- reworked the lock code to remove the 255 locks limit and to allow it to automatically deinitialize.

This commit is contained in:
Christoph Oelckers 2018-12-29 10:19:31 +01:00
commit 17e053499e
5 changed files with 81 additions and 93 deletions

View file

@ -943,6 +943,36 @@ public:
return n->Pair.Value;
}
VT &Insert(const KT key, VT &&value)
{
Node *n = FindKey(key);
if (n != NULL)
{
n->Pair.Value = value;
}
else
{
n = NewKey(key);
::new(&n->Pair.Value) VT(value);
}
return n->Pair.Value;
}
VT &InsertNew(const KT key)
{
Node *n = FindKey(key);
if (n != NULL)
{
n->Pair.Value.~VT();
}
else
{
n = NewKey(key);
}
::new(&n->Pair.Value) VT;
return n->Pair.Value;
}
//=======================================================================
//
// Remove