mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:47:35 +00:00
AK: Add fill() method to Span.
This commit is contained in:
parent
78849bbb48
commit
36080c5964
1 changed files with 7 additions and 0 deletions
|
@ -176,6 +176,13 @@ public:
|
||||||
__builtin_memmove(other.data(), data(), sizeof(T) * min(size(), other.size()));
|
__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
|
ALWAYS_INLINE const T& at(size_t index) const
|
||||||
{
|
{
|
||||||
ASSERT(index < this->m_size);
|
ASSERT(index < this->m_size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue