AK: Make to_array work with zero-sized arrays

The other overload doesn't work for zero-sized arrays.

Co-authored-by: Timothy Flynn <trflynn89@pm.me>
This commit is contained in:
Sönke Holz 2024-11-29 21:21:55 +01:00
parent 46522b2efa
commit 240db03a27

View file

@ -176,6 +176,12 @@ constexpr auto to_array(T (&&a)[N])
return Detail::to_array_impl(move(a), MakeIndexSequence<N>());
}
template<typename T>
constexpr auto to_array(Array<T, 0>)
{
return Array<T, 0> {};
}
}
#if USING_AK_GLOBALLY