mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
AK: Add FixedArray::fill_with
This is a memset-like utility method.
This commit is contained in:
parent
5b1345a4ff
commit
500dc83f32
Notes:
sideshowbarker
2024-07-17 08:39:28 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/500dc83f32 Pull-request: https://github.com/SerenityOS/serenity/pull/14424 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/sin-ack ✅
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…
Reference in a new issue