diff --git a/src/command_merge.cpp b/src/command_merge.cpp
index a9178a5f..7fcdf9a5 100644
--- a/src/command_merge.cpp
+++ b/src/command_merge.cpp
@@ -35,6 +35,7 @@ along with this program. If not, see .
#include
#include
#include
+#include
#include
#include
@@ -146,10 +147,11 @@ namespace {
return true;
}
- if (m_iterator->id() < m_last_id) {
+ static constexpr osmium::id_order id_cmp{};
+ if (id_cmp(m_iterator->id(), m_last_id)) {
throw std::runtime_error{"Objects in input file '" + m_name + "' out of order (smaller ids must come first)."};
}
- if (m_iterator->id() > m_last_id) {
+ if (id_cmp(m_last_id, m_iterator->id())) {
m_last_id = m_iterator->id();
m_last_version = m_iterator->version();
return true;