AK: Add an implementation of Array<T, Size>::fill(...)

This commit is contained in:
Brian Gianforcaro 2021-02-21 02:59:21 -08:00 committed by Andreas Kling
parent 21a959e29b
commit df73a86875
Notes: sideshowbarker 2024-07-18 22:03:36 +09:00

View file

@ -78,6 +78,14 @@ struct Array {
constexpr operator Span<const T>() const { return span(); }
constexpr operator Span<T>() { return span(); }
constexpr size_t fill(const T& value)
{
for (size_t idx = 0; idx < Size; ++idx)
__data[idx] = value;
return Size;
}
T __data[Size];
};