summaryrefslogtreecommitdiff
path: root/AK/Span.h
diff options
context:
space:
mode:
Diffstat (limited to 'AK/Span.h')
-rw-r--r--AK/Span.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/AK/Span.h b/AK/Span.h
index f8d0028934..e3c9a3eefe 100644
--- a/AK/Span.h
+++ b/AK/Span.h
@@ -156,6 +156,13 @@ public:
return this->m_values + start;
}
+ ALWAYS_INLINE constexpr void overwrite(size_t offset, const void* data, size_t data_size)
+ {
+ // make sure we're not told to write past the end
+ ASSERT(offset + data_size <= size());
+ __builtin_memcpy(this->data() + offset, data, data_size);
+ }
+
ALWAYS_INLINE constexpr size_t copy_to(Span<typename RemoveConst<T>::Type> other) const
{
ASSERT(other.size() >= size());