Skip to content

Commit 30ea192

Browse files
committed
buffer_utils: Fixed some missing span overloads so all combinations of read{BE,LE} with spans work properly
1 parent 8e8d477 commit 30ea192

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

substrate/buffer_utils

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ namespace substrate
2828
template<typename T> inline void writeBE(const T value, void *const buffer) noexcept
2929
{ internal::helper_t<T>::writeBE(value, buffer); }
3030

31+
template<typename T> inline T readLE(const span<uint8_t> buffer) noexcept
32+
{ return readLE<T>(buffer.data()); }
3133
template<typename T> inline T readLE(const span<const uint8_t> buffer) noexcept
3234
{ return readLE<T>(buffer.data()); }
3335
template<typename T> inline void writeLE(const T value, span<uint8_t> buffer) noexcept
3436
{ return writeLE(value, buffer.data()); }
3537

38+
template<typename T> inline T readBE(const span<uint8_t> buffer) noexcept
39+
{ return readBE<T>(buffer.data()); }
3640
template<typename T> inline T readBE(const span<const uint8_t> buffer) noexcept
3741
{ return readBE<T>(buffer.data()); }
3842
template<typename T> inline void writeBE(const T value, span<uint8_t> buffer) noexcept

0 commit comments

Comments
 (0)