AK: Add Array::from_repeated_value()

This commit is contained in:
Tim Schumacher 2023-11-10 01:38:53 +01:00 committed by Andrew Kaster
parent afea177d41
commit e2d4952f0f
Notes: sideshowbarker 2024-07-16 23:55:09 +09:00

View File

@ -37,6 +37,13 @@ struct Array {
return array;
}
static constexpr Array from_repeated_value(T const& value)
{
Array array;
array.fill(value);
return array;
}
[[nodiscard]] constexpr T const* data() const { return __data; }
[[nodiscard]] constexpr T* data() { return __data; }