See also
http://cplusplus.github.io/LWG/lwg-closed.html#930 (Access to std::array data as built-in array type)
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0635r0.pdf (Add c_array() member function to std::array)
https://gist.github.com/Morwenn/e49214c196353c29555678b3470e6f13 (State of C arrays in C++)
-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Do 17.08.2023 22:21
Betreff: Re: [std-proposals] Only reason I don‘t use std::array
An: std-proposals@lists.isocpp.org;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;
On Thu, Aug 17, 2023 at 9:08 PM Lénárd Szolnoki wrote:
>
> foo(a, pretend_is_std_array(a.arr)); // breaking the aliasing
> assumption here
I'll get to the point here:
How about we explicitly write in the C++26 Standard that T[len] and
array<T,len> are ABI-compatible, and also provide two functions:
stdarray_to_array
array_to_stdarray
, both of which return a reference to an object that doesn't
malfunction where you have anti-aliasing optimisations.
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals