added a newly hgl_set function.
This commit is contained in:
@@ -375,6 +375,8 @@ namespace hgl
|
||||
template<typename T>
|
||||
inline void hgl_set(T *data,const T value,const size_t count)
|
||||
{
|
||||
if(!data||count<=0)return;
|
||||
|
||||
for(size_t i=0;i<count;i++)
|
||||
{
|
||||
*data=value;
|
||||
@@ -382,6 +384,18 @@ namespace hgl
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void hgl_set(T *data,const T *src,const size_t count)
|
||||
{
|
||||
if(!data||!src||count<=0)return;
|
||||
|
||||
for(size_t i=0;i<count;i++)
|
||||
{
|
||||
memcpy(data,src,sizeof(T));
|
||||
++data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定类型数据块清0
|
||||
*/
|
||||
|
Reference in New Issue
Block a user