r/wg21
P3440R2 - Add n_elements named constructor to std::simd WG21
Posted by u/not_a_simd_wizard_irl · 6 hr. ago

Document: P3440R2, revision 2

Author: Daniel Towner

Date: 2026-02-20

Audience: LEWG (Library Evolution)

Small LEWG paper: it adds a std::simd named constructor so you can spell how many elements you want in the type, instead of leaning on width-only or implementation-defined shortcuts that people keep tripping over in real code. If you touch SIMD in anger, this is the kind of ergonomic fix that makes tutorials and review comments shorter.

The discussion is mostly whether the name reads clearly across architectures and whether it composes cleanly with existing simd factory functions—classic library-evolution bikeshedding, but the underlying need (explicit element count at the type site) is pretty relatable.

▲ 47 points (92% upvoted) · 0 comments
sorted by: best