mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
AK: Add an implementation of Array<T, Size>::fill(...)
This commit is contained in:
parent
21a959e29b
commit
df73a86875
1 changed files with 8 additions and 0 deletions
|
@ -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];
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue