Tomasz Kaminski [Tuesday, 14 October 2025, 14:53:35 CEST]:
> On Tue, Oct 14, 2025 at 2:40 PM Jonathan Wakely <[email protected]> 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.

FWIW, I proposed such a KISS iota array as part of P3319. Maybe if I add more 
motivation in terms of compile-cost LEWG considers this over the abstraction 
beasts that we have to use otherwise. But P3319 as is, is already in LWG's 
inbox.

> 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).

I'd go with keeping it simple as long as we don't need the generalization to 
0. Once we do, it's probably cheaper to handle it there via constexpr-if. Or 
we generalize it then.

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

Will do.

-Matthias

PS: I'm slow this week because I'm mostly AFK.

-- 
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                           https://mattkretz.github.io
 GSI Helmholtz Center for Heavy Ion Research               https://gsi.de
 std::simd
──────────────────────────────────────────────────────────────────────────

Reply via email to