add RangeCheck function
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user