From 4826d5d9dc524ef3d3bf83ba0a001d95ee4957f1 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Fri, 10 Feb 2023 15:58:35 +0800 Subject: [PATCH] added "set" function at AutoDeleteArray --- inc/hgl/type/Smart.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inc/hgl/type/Smart.h b/inc/hgl/type/Smart.h index 249dcdf..e86b6eb 100644 --- a/inc/hgl/type/Smart.h +++ b/inc/hgl/type/Smart.h @@ -539,6 +539,15 @@ namespace hgl delete[] obj; } + void set(T *o,const size_t count) + { + if(obj) + delete[] obj; + + obj=o; + size=count; + } + T *alloc(const size_t count) { if(!obj)