aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-24 17:00:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-24 17:00:16 +0000
commita0dfea75f287921a0bbf7d46c6536ac53f81c927 (patch)
tree463f9acacba60b1a88934ae4629f819d0d1febcc
parentf13aa4c0963548f6827744f2d5685c852684e80b (diff)
downloadpaludis-a0dfea75f287921a0bbf7d46c6536ac53f81c927.tar.gz
paludis-a0dfea75f287921a0bbf7d46c6536ac53f81c927.tar.xz
Add in some more <=> compare function overloads for types that can be passed more quickly by value than by reference
-rw-r--r--paludis/compare.hh36
1 files changed, 36 insertions, 0 deletions
diff --git a/paludis/compare.hh b/paludis/compare.hh
index 57ad38d..b44bfc2 100644
--- a/paludis/compare.hh
+++ b/paludis/compare.hh
@@ -21,6 +21,42 @@ namespace paludis
return 0;
}
+ inline int compare(unsigned t1, unsigned t2) PALUDIS_ATTRIBUTE((always_inline));
+
+ inline int compare(unsigned t1, unsigned t2)
+ {
+ if (t1 < t2)
+ return -1;
+ else if (t2 > t1)
+ return 1;
+ else
+ return 0;
+ }
+
+ inline int long compare(unsigned long t1, unsigned long t2) PALUDIS_ATTRIBUTE((always_inline));
+
+ inline int long compare(unsigned long t1, unsigned long t2)
+ {
+ if (t1 < t2)
+ return -1;
+ else if (t2 > t1)
+ return 1;
+ else
+ return 0;
+ }
+
+ inline int compare(long t1, long t2) PALUDIS_ATTRIBUTE((always_inline));
+
+ inline int compare(long t1, long t2)
+ {
+ if (t1 < t2)
+ return -1;
+ else if (t2 > t1)
+ return 1;
+ else
+ return 0;
+ }
+
template <typename T_>
inline int compare(
const std::basic_string<T_> & t1,