19 lines
388 B
C++
19 lines
388 B
C++
#pragma once
|
|
|
|
#include "VersionedMap.h"
|
|
|
|
#include <algorithm>
|
|
#include <string.h>
|
|
|
|
inline auto operator<=>(const weaselab::VersionedMap::Key &lhs,
|
|
const weaselab::VersionedMap::Key &rhs) {
|
|
int cl = std::min(lhs.len, rhs.len);
|
|
if (cl > 0) {
|
|
int c = memcmp(lhs.p, rhs.p, cl);
|
|
if (c != 0) {
|
|
return c <=> 0;
|
|
}
|
|
}
|
|
return lhs.len <=> rhs.len;
|
|
}
|