summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2026-04-07 11:46:07 +0200
committerJulian Andres Klode <jak@debian.org>2026-04-07 11:46:07 +0200
commitf2c87504c4c3517a8420d789e40411f74fe45e19 (patch)
treeb5ed6075a2ac295f79dc0ef3c30aa67407aa3ff3
parent02a6910f9683b0167c0783423ce9b0e6decddc45 (diff)
hashes: Use std::span instead of std::basic_string_view
std::basic_string_view should not be initialized locally, only in the std library. Replace it with a simple span instead. This should fix compilation with LLVM 18+. Supersedes: https://salsa.debian.org/apt-team/apt/-/merge_requests/511
-rw-r--r--apt-pkg/contrib/hashes.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc
index 9c0ce40d2..74419b63b 100644
--- a/apt-pkg/contrib/hashes.cc
+++ b/apt-pkg/contrib/hashes.cc
@@ -296,7 +296,7 @@ bool HashStringList::operator!=(HashStringList const &other) const
return !(*this == other);
}
/*}}}*/
-static APT_PURE std::string HexDigest(std::basic_string_view<unsigned char> const &Sum)
+static APT_PURE std::string HexDigest(std::span<unsigned char> const &Sum)
{
char Conv[16] =
{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
@@ -360,7 +360,7 @@ class PrivateHashes
EVP_DigestFinal_ex(tmpContext, Sum, nullptr);
EVP_MD_CTX_destroy(tmpContext);
- return ::HexDigest(std::basic_string_view<unsigned char>(Sum, Size));
+ return ::HexDigest(std::span<unsigned char>(Sum, Size));
}
bool Enable(HashAlgo const &algo)