Closed sultim-t closed 1 year ago
Describe the bug erase_if returns current_size - old_size which is a negative value that is cast to an unsigned size_t on return. https://github.com/martinus/unordered_dense/blob/fefa511ca94b145eca1e102da46ecb27cd03846c/include/ankerl/unordered_dense.h#L1910
erase_if
current_size - old_size
size_t
To Reproduce Steps to reproduce the behavior:
Expected behavior erase_if should return old_size - current_size, not current_size - old_size
old_size - current_size
System (please complete the following information):
Additional context None.
Ha, you are of course correct, this is a bug. It seems whenever I don't have a test for something I'll do it wrong. I'll create a new release with the fix.
I've created release v4.0.1 with this fix. Thanks!
Describe the bug
erase_if
returnscurrent_size - old_size
which is a negative value that is cast to an unsignedsize_t
on return. https://github.com/martinus/unordered_dense/blob/fefa511ca94b145eca1e102da46ecb27cd03846c/include/ankerl/unordered_dense.h#L1910To Reproduce Steps to reproduce the behavior:
erase_if
Expected behavior
erase_if
should returnold_size - current_size
, notcurrent_size - old_size
System (please complete the following information):
Additional context None.