mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 10:36:24 +00:00
AK: Add fill() method to Span.
This commit is contained in:
parent
78849bbb48
commit
36080c5964
|
@ -176,6 +176,13 @@ public:
|
|||
__builtin_memmove(other.data(), data(), sizeof(T) * min(size(), other.size()));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void fill(const T& value)
|
||||
{
|
||||
for (size_t idx = 0; idx < size(); ++idx) {
|
||||
data()[idx] = value;
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE const T& at(size_t index) const
|
||||
{
|
||||
ASSERT(index < this->m_size);
|
||||
|
|
Loading…
Reference in a new issue