5 ms·
Well yeah, but then there's stupid design warts like size_t being unsigned, and it's much too late to fix this now.
by flohofwoe 5y ago
Well yeah, but then there's stupid design warts like size_t being unsigned, and it's much too late to fix this now.
- microtherion 5y agoHow many objects of negative size are you typically dealing with?
- flohofwoe 5y agoThis isn't the problem, but that it almost always makes sense to use signed math for computations (including computations that involve sizes). And mixed-sign-math in a language that doesn't have robust over/underflow detection but implicit conversion between signed and unsigned is usually a very bad idea. The only advantage that an unsigned size_t gives is one bit more range (but these days this is irrelevant - 63 bits ought to be enough for anyone). But this topic really has been discussed to death in the last decade or so :)