AK: Add FixedArray::fill_with

This is a memset-like utility method.
This commit is contained in:
kleines Filmröllchen 2022-06-27 23:30:44 +02:00 committed by Linus Groh
parent 5b1345a4ff
commit 500dc83f32

View file

@ -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>;