mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +00:00
AK: Add FixedArray::fill_with
This is a memset-like utility method.
This commit is contained in:
parent
5b1345a4ff
commit
500dc83f32
1 changed files with 6 additions and 0 deletions
|
@ -160,6 +160,12 @@ public:
|
|||
::swap(m_elements, other.m_elements);
|
||||
}
|
||||
|
||||
void fill_with(T const& value)
|
||||
{
|
||||
for (size_t i = 0; i < m_size; ++i)
|
||||
m_elements[i] = value;
|
||||
}
|
||||
|
||||
using Iterator = SimpleIterator<FixedArray, T>;
|
||||
using ConstIterator = SimpleIterator<FixedArray const, T const>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue