aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/package29
1 files changed, 29 insertions, 0 deletions
diff --git a/bpkg/package b/bpkg/package
index ac0ac0f..12079f6 100644
--- a/bpkg/package
+++ b/bpkg/package
@@ -456,6 +456,15 @@ namespace bpkg
template <typename T1, typename T2>
inline auto
+ operator!= (const T1& x, const T2& y) -> decltype (x.epoch != y.epoch)
+ {
+ return x.epoch != y.epoch ||
+ x.canonical_upstream != y.canonical_upstream ||
+ x.revision != y.revision;
+ }
+
+ template <typename T1, typename T2>
+ inline auto
operator< (const T1& x, const T2& y) -> decltype (x.epoch < y.epoch)
{
return x.epoch < y.epoch ||
@@ -466,6 +475,16 @@ namespace bpkg
template <typename T1, typename T2>
inline auto
+ operator<= (const T1& x, const T2& y) -> decltype (x.epoch <= y.epoch)
+ {
+ return x.epoch < y.epoch ||
+ (x.epoch == y.epoch && x.canonical_upstream < y.canonical_upstream) ||
+ (x.epoch == y.epoch && x.canonical_upstream == y.canonical_upstream &&
+ x.revision <= y.revision);
+ }
+
+ template <typename T1, typename T2>
+ inline auto
operator> (const T1& x, const T2& y) -> decltype (x.epoch > y.epoch)
{
return x.epoch > y.epoch ||
@@ -474,6 +493,16 @@ namespace bpkg
x.revision > y.revision);
}
+ template <typename T1, typename T2>
+ inline auto
+ operator>= (const T1& x, const T2& y) -> decltype (x.epoch >= y.epoch)
+ {
+ return x.epoch > y.epoch ||
+ (x.epoch == y.epoch && x.canonical_upstream > y.canonical_upstream) ||
+ (x.epoch == y.epoch && x.canonical_upstream == y.canonical_upstream &&
+ x.revision >= y.revision);
+ }
+
template <typename T>
inline auto
order_by_version_desc (const T& x) -> //decltype ("ORDER BY" + x.epoch)