mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-15 13:43:00 +02:00
scripted-diff: rename BytePtr to AsBytePtr
Building with iPhoneOS SDK fails because it also has `BytePtr` defined in /usr/include/MacTypes.h. -BEGIN VERIFY SCRIPT- sed -i 's/BytePtr/AsBytePtr/' $(git grep -l "BytePtr" src) -END VERIFY SCRIPT-
This commit is contained in:
@ -245,19 +245,19 @@ T& SpanPopBack(Span<T>& span)
|
||||
|
||||
//! Convert a data pointer to a std::byte data pointer.
|
||||
//! Where possible, please use the safer AsBytes helpers.
|
||||
inline const std::byte* BytePtr(const void* data) { return reinterpret_cast<const std::byte*>(data); }
|
||||
inline std::byte* BytePtr(void* data) { return reinterpret_cast<std::byte*>(data); }
|
||||
inline const std::byte* AsBytePtr(const void* data) { return reinterpret_cast<const std::byte*>(data); }
|
||||
inline std::byte* AsBytePtr(void* data) { return reinterpret_cast<std::byte*>(data); }
|
||||
|
||||
// From C++20 as_bytes and as_writeable_bytes
|
||||
template <typename T>
|
||||
Span<const std::byte> AsBytes(Span<T> s) noexcept
|
||||
{
|
||||
return {BytePtr(s.data()), s.size_bytes()};
|
||||
return {AsBytePtr(s.data()), s.size_bytes()};
|
||||
}
|
||||
template <typename T>
|
||||
Span<std::byte> AsWritableBytes(Span<T> s) noexcept
|
||||
{
|
||||
return {BytePtr(s.data()), s.size_bytes()};
|
||||
return {AsBytePtr(s.data()), s.size_bytes()};
|
||||
}
|
||||
|
||||
template <typename V>
|
||||
|
Reference in New Issue
Block a user