first commit

This commit is contained in:
2019-08-19 19:19:58 +08:00
parent 7bb6b54204
commit 2b71bf8135
145 changed files with 23208 additions and 0 deletions

16
inc/hgl/CompOperator.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef HGL_COMP_OPERATOR_INCLUDE
#define HGL_COMP_OPERATOR_INCLUDE
namespace hgl
{
#define CompOperator(name,compfunc) const bool operator > (name i)const {return compfunc(i)>0;} \
const bool operator < (name i)const {return compfunc(i)<0;} \
const bool operator >=(name i)const {return compfunc(i)>=0;}\
const bool operator <=(name i)const {return compfunc(i)<=0;}\
const bool operator ==(name i)const {return compfunc(i)==0;}\
const bool operator !=(name i)const {return compfunc(i)!=0;}
#define CompOperatorMemcmp(name) int _Comp(name data)const{return memcmp(this,&data,sizeof(name));} \
CompOperator(name,_Comp)
}//namespace hgl
#endif//HGL_COMP_OPERATOR_INCLUDE