added hgl_cmp at TypeFunc.h

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-05-04 19:03:43 +08:00
parent d4d8af1bdc
commit fbe4815c74

View File

@ -451,6 +451,18 @@ namespace hgl
return data;
}
template<typename T>
inline int hgl_cmp(const T &a,const T &b)
{
return memcmp(&a,&b,sizeof(T));
}
template<typename T>
inline int hgl_cmp(const T *a,const T *b,const size_t count)
{
return memcmp(a,b,count*sizeof(T));
}
/**
* 0
*/