diff options
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Span.h | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -164,15 +164,18 @@ public: return this->m_values + start; } - ALWAYS_INLINE void copy_to(Span other) const + ALWAYS_INLINE size_t copy_to(Span<typename RemoveConst<T>::Type> other) const { ASSERT(other.size() >= size()); __builtin_memmove(other.data(), data(), sizeof(T) * size()); + return size(); } - ALWAYS_INLINE void copy_trimmed_to(Span other) const + ALWAYS_INLINE size_t copy_trimmed_to(Span<typename RemoveConst<T>::Type> other) const { - __builtin_memmove(other.data(), data(), sizeof(T) * min(size(), other.size())); + auto count = min(size(), other.size()); + __builtin_memmove(other.data(), data(), sizeof(T) * count); + return count; } ALWAYS_INLINE void fill(const T& value) |