util/HexFormat: require std::span

This commit is contained in:
Max Kellermann 2022-06-29 17:22:11 +02:00
parent dcf39ee44e
commit 4cb5c3782b
1 changed files with 1 additions and 10 deletions

View File

@ -34,6 +34,7 @@
#include <array>
#include <cstdint>
#include <span>
constexpr char hex_digits[] = "0123456789abcdef";
@ -81,14 +82,6 @@ HexFormatUint64Fixed(char dest[16], uint64_t number) noexcept
return dest;
}
#if __cplusplus >= 202002 || (defined(__GNUC__) && __GNUC__ >= 10)
#include <version>
#endif
#ifdef __cpp_lib_span
#include <array>
#include <span>
/**
* Format the given input buffer of bytes to hex. The caller ensures
* that the output buffer is at least twice as large as the input.
@ -117,5 +110,3 @@ HexFormat(std::span<const std::byte, size> input) noexcept
HexFormat(output.data(), input);
return output;
}
#endif