aboutsummaryrefslogtreecommitdiff
path: root/bpkg/types.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-09-23 20:51:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-09-24 11:27:09 +0300
commitfa002aac4c3cb75722d973d199a73231062b890c (patch)
treeb09d44844bae7528d63689dfaf7e46d4b668733c /bpkg/types.hxx
parent3f86fb3b73731f680bcffda83e4dddb6914eb13a (diff)
Make database ordering consistent across runs
Diffstat (limited to 'bpkg/types.hxx')
-rw-r--r--bpkg/types.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/bpkg/types.hxx b/bpkg/types.hxx
index d8ffa79..8f6d9df 100644
--- a/bpkg/types.hxx
+++ b/bpkg/types.hxx
@@ -180,9 +180,15 @@ namespace bpkg
//
return x.object_id () != y.object_id ()
? (x.object_id () < y.object_id ())
- : (&static_cast<typename P::base_type> (x).database () <
- &static_cast<typename P::base_type> (y).database ());
+ : less (static_cast<typename P::base_type> (x).database (),
+ static_cast<typename P::base_type> (y).database ());
}
+
+ private:
+ // Defined in database.cxx.
+ //
+ bool
+ less (const odb::database&, const odb::database&) const;
};
// Compare two lazy pointers via the pointed-to object ids.