mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
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:
parent
46522b2efa
commit
240db03a27
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue