P2964R5 — Allowing user-defined types in std::simd
LEWGSG6
The C++ standard library includes data-parallel types in the `<simd>` header, currently restricting element types to a closed list of *built-in vectorizable* types: arithmetic types and `std::complex` specializations. This paper proposes a minimal change to the specification in which this list is extended. Firstly, `std::byte` is added to the closed list as a standard library type with fixed semantics that the implementation handles directly. Secondly, trait-based constraints define a second category of *user-defined vectorizable* types as any type that is trivially copyable, of appropriate size, and not explicitly opted out. All existing built-in vectorizable types retain their current semantics unchanged, while support naturally extends to enumerations and user-defined types.