The example code attached no longer compiles in 1.16. It used to compile in 1.15. Removing the `private` access modifier from the destructor allows it to compile but then opens up the script to be referenced counted and deleted outside of the desired bounds.
```
class SomeClass
{
private static ref map<string, ref SomeClass> s_All = new map<string, ref SomeClass>();
private string m_Name;
private void SomeClass();
private void ~SomeClass();
static bool Create(out SomeClass instance, string name)
{
instance = new SomeClass();
instance.m_Name = name;
s_All.Insert(name, instance);
return true;
}
static bool Delete(SomeClass instance)
{
if (!instance) return false;
s_All.Remove(instance.m_Name);
return true;
}
string GetName()
{
return m_Name;
}
};
```