summaryrefslogtreecommitdiff
path: root/include/class.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-12 13:53:48 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-12 13:53:48 +0100
commit8e792d31f499758d3447da46dc85b68356bdbe9b (patch)
treea0545bae9fc9e6c28cf93e449b896e583483bf7f /include/class.h
parentf8775b64f67cc464e024cf79cd98eed30c659d25 (diff)
removed __compare magic method, and added operator< instead
Diffstat (limited to 'include/class.h')
-rw-r--r--include/class.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/class.h b/include/class.h
index eabcec6..427aa64 100644
--- a/include/class.h
+++ b/include/class.h
@@ -197,7 +197,11 @@ private:
T *t2 = (T *)object2;
// compare the two objects
- return t1->__compare(*t2);
+ if (*t1 < *t2) return -1;
+ if (*t1 > *t2) return 1;
+
+ // they must be identical
+ return 0;
}
/**