Repository navigation
Format 2.0. No byte a writer emits changed. STANDARD.md and conformance/ are unchanged, so ports need not re-vendor them. IMPLEMENTING.md U7, U11 and U16 state the behaviours below for every port.
- A read refuses a value its destination cannot hold (U16). The read returns
value_out_of_rangeand leaves the destination unwritten.- Ranged reads (
serialize_int,serialize_int64,serialize_int128, theirread_and compile time forms) judge the value with its sign: 300 over [0,1000] into auint8_trefuses. int_relativejudges the reconstruction: 135000 into auint16_tcurrent refuses.- Raw bit reads (
serialize_bits, theuintNandboolforms,read_bits, the compile time bits forms) judge the bit pattern. They accept when the lowbitsbits of the destination's two's complement value equal the bits read. Soff ff ff ffin 32 bits reads into anint32_tas -1, and 300 in 16 bits into auint8_trefuses. - Writing a negative value through a raw bit field stays caller error.
- A C++ bit-field destination is checked against its declared type, not its width.
- Ranged reads (
- bytes. A null destination with a positive count refuses on read (U7). A zero-length block with a null pointer,
nullptrincluded, is accepted on every stream and still aligns. - string. A read refused for its payload's content leaves the buffer NUL terminated after the bytes read.
- A write after a flush that stored a partial word asserts (U11).
serialize_int,serialize_int64,serialize_bitsand theirread_andwrite_forms evaluatevalue,min,maxandbitsonce.read_stringresolves for stream types declared outside namespaceserialize.- The compile time int forms take Min == Max as a zero-bit field, as the runtime forms do.
compressed_floatrounds every intermediate to float32.BitsRequired,PopCountandLog2takeuint64_tand count ranges wider than 32 bits (BitsRequired<0,4294967296>is 33).- Macro locals are named
serialize_macro_*_, and the header is clean under-Wshadow, GCC's broader set and clang's-Weverythingon the consumer translation unit.