first commit
This commit is contained in:
16
inc/hgl/CompOperator.h
Normal file
16
inc/hgl/CompOperator.h
Normal 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
|
Reference in New Issue
Block a user