size_t.max-sentinel semantics are avoided:
the count itself is rejected by the encoder if the bound would overflow (callers get INSUFFICIENT_CAPACITY from encode).
size_t maxEncodedSize(size_t count, ubyte widthBytes) @safe pure nothrow @nogcMaximum byte length encode* can emit for count values at element width widthBytes (conservative: a varint header per token plus payload; greedy literals pair up, single values may stand alone). Checked against size_t overflow.
count | number of input values. |
widthBytes | element width W in {1,2,4,8}. |
size_t.max-sentinel semantics are avoided:
the count itself is rejected by the encoder if the bound would overflow (callers get INSUFFICIENT_CAPACITY from encode).