add RangeCheck function

This commit is contained in:
2020-09-05 10:52:11 +08:00
parent 7927586bd1
commit cc2b6c4952

View File

@@ -9,6 +9,14 @@ namespace hgl
#define ENUM_CLASS_RANGE(begin,end) BEGIN_RANGE=begin,END_RANGE=end,RANGE_SIZE=(END_RANGE-BEGIN_RANGE)+1
template<typename T>
inline bool RangeCheck(const T &value)
{
if(value<T::BEGIN_RANGE)return(false);
if(value>T::END_RANGE)return(false);
return(true);
}
#define HGL_CONVER_TO_MEM_ALIGN(x) ((((x)+HGL_MEM_ALIGN-1)/HGL_MEM_ALIGN)*HGL_MEM_ALIGN) //内存对齐转换宏
#ifndef NULL