KrisLibrary  1.0.0
cmp_func.h
1 #ifndef UTILS_CMP_FUNC_H
2 #define UTILS_CMP_FUNC_H
3 
4 #include <functional>
5 
6 namespace std {
7 
12 template <class T,class Less=less<T> >
13 struct cmp_func
14 {
15  int operator()(const T& a,const T& b) {
16  if(lessFunc(a,b)) return -1;
17  else if(lessFunc(b,a)) return 1;
18  return 0;
19  }
20  Less lessFunc;
21 };
22 
23 } //namespace std
24 
25 #endif
A templated function class like strcmp: returns -1 if a<b, 0 if a==b, 1 if a>b.
Definition: cmp_func.h:13
Definition: rayprimitives.h:132