diff --git a/inc/hgl/Comparator.h b/inc/hgl/Comparator.h index b27333e..f13c8a9 100644 --- a/inc/hgl/Comparator.h +++ b/inc/hgl/Comparator.h @@ -33,4 +33,25 @@ namespace hgl return memcmp(this,&other,sizeof(T)); } };//class ComparatorData + + template class ItemComparator + { + + public: + + static const int compare(const T &a,const T &b); + + static void cpy(T *dst,const T *src) + { + memcpy(dst,src,sizeof(T)); + } + + static void exchange(T &a,T &b) + { + T temp; + cpy(&temp,&a); + cpy(&a,&b); + cpy(&b,&temp); + } + }; }//namespace hgl