added "set" function at AutoDeleteArray

This commit is contained in:
2023-02-10 15:58:35 +08:00
parent 5441a7dd1c
commit 4826d5d9dc

View File

@@ -539,6 +539,15 @@ namespace hgl
delete[] obj; delete[] obj;
} }
void set(T *o,const size_t count)
{
if(obj)
delete[] obj;
obj=o;
size=count;
}
T *alloc(const size_t count) T *alloc(const size_t count)
{ {
if(!obj) if(!obj)