6 ms·
I thought `ssize_t` was only signed `size_t` in practice. Technically, it only needs to be `size_t` with -1.
by Xophmeister 11y ago
I thought `ssize_t` was only signed `size_t` in practice. Technically, it only needs to be `size_t` with -1.
- whyever 11y agoHow would that work? You need an additional bit.
- julian-klode 11y agoYou could just store using offsets instead. You don't have to do sign bit. 2 bit example: 00 => -1 01 => 0 10 => 1 11 => 2 or: 2 bit example: 00 => -2 01 => -1 10 => 0 11 => 1 This even wrapsaround naturally.