[PATCH] libstdc++: Implement _IndexPack helper utility for structured binding.

Tomasz Kaminski tkaminsk@redhat.com
Tue Oct 14 12:53:35 GMT 2025


On Tue, Oct 14, 2025 at 2:40 PM Jonathan Wakely <jwakely@redhat.com> wrote:

> On Tue, 14 Oct 2025 at 10:09, Matthias Kretz wrote:
> >
> > See attached test.cpp. I prefer the VIA_ARRAY=1 solution (generalized to
> > arbitrary integer types).
>
> That's nice!
>
> And simpler to understand IMHO as well as cheaper to compile.
>
It does not work with zero elements, so that is a bit of shame, but that
could be fixed with some conditional_t,
where the type is conditional_t<N == 0, _Empty, _T[N]> (we need some
wrapper so we do not instantiate array early).

Mathias, could you extract your version from simd and post it as a separate
patch?

Regards,
Tomasz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20251014/a67f0132/attachment-0001.htm>


More information about the Libstdc++ mailing list