P3983R0 — Object Representation for std::simd (6 items) LWG, LEWG
Daniel Towner
The C++26 Working Draft makes std::simd types trivially copyable, enabling std::bit_cast, but leaves the object representation unspecified, preventing portable bit reinterpretation idioms widely used in SIMD programming. This paper proposes mandating an array-like object representation (contiguous, index-ordered, no padding) for basic_vec> specializations, reflecting universal hardware practice, and additionally providing is_simd_array_like_v and is_mask_array_like_v query traits so generic code can discover layout properties for other ABIs. The fixed_size ABI is explicitly excluded from the layout mandate due to divergent implementation strategies and is left for future work.

References — Anthropic Citations API

[1] chars 2197–2371
"Since basic_vec is conceptually similar to array (both are fixed-size containers of homogeneous elements), users naturally expect similar bit-casting guarantees. "
[2]
"Returns: For is_simd_array_like_v: true if the object representation of basic_vec is identical to the object representation of array and Remarks: is_simd_array_like_v
[3] chars 8394–8645
"Recommended practice for conversions: The draft states "Implementations should support implicit conversions between specializations of basic_vec and appropriate implementation-defined types (see..."
Summary: P3983R0 proposes guaranteeing that std::simd (basic_vec) has an object representation identical to a std::array of the same element type and size, enabling reinterpret_cast, memcpy, and similar low-level operations between simd objects and arrays. It evaluates several approaches and recommends a combination of a normative array-like layout requirement and type traits to query that guarantee.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.