mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Fixed C++20 deprecation warning for std::rel_ops::operator<=
Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
committed by
Konstantin Pastbin
parent
2aaf37e9ee
commit
7781528263
@@ -451,6 +451,17 @@ bool operator>(buffer_vector<T, N1> const & v1, buffer_vector<T, N2> const & v2)
|
||||
{
|
||||
return v2 < v1;
|
||||
}
|
||||
// TODO(AB): Use <=> operator.
|
||||
// Used in:
|
||||
// TrieChar const * const keyData = entry.GetKeyData();
|
||||
// TTrieString key(keyData, keyData + entry.GetKeySize());
|
||||
// using namespace std::rel_ops; // ">=" for keys.
|
||||
// CHECK_GREATER_OR_EQUAL(key, prevKey, (key, prevKey));
|
||||
template <typename T, size_t N1, size_t N2>
|
||||
bool operator>=(buffer_vector<T, N1> const & v1, buffer_vector<T, N2> const & v2)
|
||||
{
|
||||
return !(v1 < v2);
|
||||
}
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@ void BuildSuccinctTrie(TWriter & writer, TIter const beg, TIter const end)
|
||||
continue;
|
||||
TrieChar const * const keyData = entry.GetKeyData();
|
||||
TTrieString key(keyData, keyData + entry.GetKeySize());
|
||||
using namespace std::rel_ops; // ">=" for keys.
|
||||
|
||||
CHECK_GREATER_OR_EQUAL(key, prevKey, (key, prevKey));
|
||||
entries.push_back(entry);
|
||||
entryStrings.push_back(strings::UniString(keyData, keyData + entry.GetKeySize()));
|
||||
|
||||
@@ -214,7 +214,6 @@ void AppendValue(NodeInfo & node, Value const & value)
|
||||
// order so the values are supposed to be accumulated in the
|
||||
// sorted order and we can avoid sorting them before doing
|
||||
// further operations such as ValueList construction.
|
||||
using namespace std::rel_ops;
|
||||
ASSERT(node.m_temporaryValueList.empty() || node.m_temporaryValueList.back() <= value,
|
||||
(node.m_temporaryValueList.size()));
|
||||
if (!node.m_temporaryValueList.empty() && node.m_temporaryValueList.back() == value)
|
||||
|
||||
@@ -23,9 +23,7 @@ struct Uint64IndexValue
|
||||
|
||||
explicit Uint64IndexValue(uint64_t featureId) : m_featureId(featureId) {}
|
||||
|
||||
bool operator<(Uint64IndexValue const & o) const { return m_featureId < o.m_featureId; }
|
||||
|
||||
bool operator==(Uint64IndexValue const & o) const { return m_featureId == o.m_featureId; }
|
||||
auto operator<=>(Uint64IndexValue const &) const = default;
|
||||
|
||||
void Swap(Uint64IndexValue & o) { std::swap(m_featureId, o.m_featureId); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user