On Monday, February 28th, 2022 at 8:44 AM, Paolo Di Giglio via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
I'd like to propose a specialization of function template std::get for
C-style arrays. A simple two-liner would provide compile-time catching
of out-of-bound array accesses (please note we already have this check
for the std::array specialization):

template <std::size_t Idx, typename T, std::size_t N>
constexpr T& get(T (&arr)[N]) noexcept
{
static_assert(Idx < N, "Index out of bounds");
return arr[Idx];
}


I had that thought back in

Use array as a tuple - 4BSD (miator.net)

It is worth noticing that the latter added
structured binding has special rules for
arrays, so enabling tuple-interface on
arrays may cause some confusion.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________