On Fri, 15 Dec 2023 at 21:56, Ryan Nicholl via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
I would like to semi-formally propose a defect report related to std::array and existing standards.

It turns out std::array<T, 0> cannot be implemented in C++17 without the use of magic compiler builtins. libc++, libstdc++, and I think also MSVC are all non-compliant.

Begin and end are required to return a unique pointer, the only constexpr method I have found to do this is taking the address of a union member. However, that approach breaks if T is non-trivial.

This isĀ https://cplusplus.github.io/LWG/issue2157


Glibc libstdc++ libc++ ignores the standard requirement of uniqueness in favor of following the trivial and constexpr requirements. Both of these implementations return nullptr.

N.B. There's no such thing as Glibc libstdc++. Libstdc++ is part of GCC, which is a completely separate project from Glibc.