P4030R0 — Endian Views
(4 items)
SG-9 Ranges, SG-16 Unicode, LEWG
This paper proposes four range adaptor objects—from_little_endian, from_big_endian, to_little_endian, and to_big_endian—that perform byte-swapping on ranges of integral values to convert between native and specified endianness. The primary motivation is to complement the UTF transcoding range adaptors from P2728R7, enabling users to handle UTF-16LE, UTF-16BE, UTF-32LE, and UTF-32BE encodings without a combinatorial explosion of endianness-aware transcoding adaptors. The adaptors are also broadly useful for network protocols and binary file formats.
- Section 4 (Wording), all four adaptor definitions — range_value_t is qualified as ranges::range_value_t in the constraint paragraph but used unqualified in the expression-equivalent bullet. This inconsistency is repeated across all four adaptors. [1]
- Section 4 (Wording), code block cb5 — Stray trailing / after exposition only in the comment for byteswap-if-native-is-big-endian. Should read // exposition only without the trailing slash. [2]
- Section 4 (Wording), code block cb6 — Same stray trailing / after exposition only in the comment for byteswap-if-native-is-little-endian. [3]
References — Anthropic Citations API
[1]
"struct byteswap-if-native-is-big-endian { // exposition only/"
"struct byteswap-if-native-is-big-endian { // exposition only/"
[2]
"struct byteswap-if-native-is-little-endian { // exposition only/"
"struct byteswap-if-native-is-little-endian { // exposition only/"
[3]
"Constraint paragraph: "If `ranges::range_value_t` does not model `integral`" vs empty_view bullet: "empty_view>{}""
"Constraint paragraph: "If `ranges::range_value_t
Summary: P4030R0 proposes four range adaptors (from_little_endian, from_big_endian, to_little_endian, to_big_endian) that reinterpret ranges of bytes as ranges of integral values with specified endianness, and vice versa. Three wording-level defects were found: two stray characters in exposition-only comments and an inconsistent namespace qualification pattern repeated across all four adaptor definitions.
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.