P3973R0 — bit_cast_as: Element type reinterpretation for std::simd
(5 items)
LEWG, SG1
This paper proposes std::bit_cast_as(), a free function that reinterprets std::simd objects at different element granularities by automatically inferring the output element count from the sizes of the source and target types, eliminating the need for manual count computation required by std::bit_cast. The facility provides compile-time size verification and relies on array-like layout guarantees for std::simd proposed in P3983R0. The design is also presented as naturally generalizing to std::array and std::span, with value types returning copies and view types returning reinterpreted views.
-
Section 5.4 vs. Sections 5.3/3.3 — rebind_t
in Section 5.4 passes an ABI tag as the second argument, but rebind_t in Sections 5.3 and 3.3 passes a simd type (basic_vec). The two uses are incompatible; Section 5.4 should use rebind_t > or the ABI-level alias simd_abi::rebind_t . [1] [1] - Section 9.2, Remarks — P{array} is an unresolved placeholder for a paper number; should be P3983R0 per the paper's own stated dependency. [2] [2]
- Section 9.2 heading — Stable name rendered as [simd. bit_cast_as] with a spurious space after the period; should be [simd.bit_cast_as]. [3] [3]
References — Anthropic Citations API
[1]
"using new_vec = resize_t>;" (§5.4) and "using new_type = rebind_t>;" (§5.3)"
"using new_vec = resize_t
[2]
chars 18676–18791
"The bit representation interpretation requires that simd types have array-like layout as specified in P{array}. "
"The bit representation interpretation requires that simd types have array-like layout as specified in P{array}. "
[3]
chars 17835–18676
"Header synopsis additions
```
namespace std {
template
simd bit_cast_as(const simd& v) noexcept;
}
```
### 9.2...."
"Header
Summary: P3973R0 proposes bit_cast_as, a free function template that reinterprets the element type of a std::simd value while preserving its bit-level representation and total size, analogous to std::bit_cast but operating on SIMD vectors. Three defects were found in the proposed wording and code samples.
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.
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.