removed repeated hgl_zero

This commit is contained in:
2023-07-21 10:47:12 +08:00
parent 205d246e8a
commit 5e2976418d

View File

@@ -401,6 +401,15 @@ namespace hgl
} }
} }
/**
* 指定类型数据清0
*/
template<typename T>
inline void hgl_zero(T &data)
{
memset(&data,0,sizeof(T));
}
/** /**
* 指定类型数据块清0 * 指定类型数据块清0
*/ */
@@ -466,24 +475,6 @@ namespace hgl
return memcmp(a,b,count*sizeof(T)); return memcmp(a,b,count*sizeof(T));
} }
/**
* 指定类型数据清0
*/
template<typename T>
inline void hgl_zero(T &data)
{
memset(&data,0,sizeof(T));
}
/**
* 指定类型数据清0
*/
template<typename T>
inline void hgl_zero(T *data,const uint count)
{
memset(data,0,sizeof(T)*count);
}
template<typename T> template<typename T>
inline T *array_alloc(const uint count) inline T *array_alloc(const uint count)
{ {