P4030R0 — Endian Views (4 items) SG-9 Ranges, SG-16 Unicode, LEWG
Eddie Nolan
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.

References — Anthropic Citations API

[1]
"struct byteswap-if-native-is-big-endian { // exposition only/"
[2]
"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>{}""
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.