mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-15 13:33:07 +02:00
refactor: Remove Span operator==, Use std::ranges::equal
This commit is contained in:
@ -5,11 +5,11 @@
|
||||
#ifndef BITCOIN_SPAN_H
|
||||
#define BITCOIN_SPAN_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <span>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#ifdef DEBUG
|
||||
#define CONSTEXPR_IF_NOT_DEBUG
|
||||
@ -213,13 +213,6 @@ public:
|
||||
return Span<C>(m_data + m_size - count, count);
|
||||
}
|
||||
|
||||
friend constexpr bool operator==(const Span& a, const Span& b) noexcept { return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin()); }
|
||||
friend constexpr bool operator!=(const Span& a, const Span& b) noexcept { return !(a == b); }
|
||||
friend constexpr bool operator<(const Span& a, const Span& b) noexcept { return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end()); }
|
||||
friend constexpr bool operator<=(const Span& a, const Span& b) noexcept { return !(b < a); }
|
||||
friend constexpr bool operator>(const Span& a, const Span& b) noexcept { return (b < a); }
|
||||
friend constexpr bool operator>=(const Span& a, const Span& b) noexcept { return !(a < b); }
|
||||
|
||||
template <typename O> friend class Span;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user