add span equality and span for bin2hex

This commit is contained in:
2024-04-10 13:26:54 +02:00
parent 659b410caa
commit bee42d4688
3 changed files with 25 additions and 4 deletions

View File

@@ -39,6 +39,20 @@ struct Span final {
return ptr[i];
}
constexpr bool operator==(const Span& other) const {
if (empty() || size != other.size) {
return false;
}
for (uint64_t i = 0; i < size; i++) {
if ((*this)[i] != other[i]) {
return false;
}
}
return true;
}
#if 0
constexpr T& operator[](uint64_t i) {
if (i > size) {