Tessil / ordered-map

C++ hash map and hash set which preserve the order of insertion
MIT License
512 stars 66 forks source link

fix deserialize when rehash pending #26

Closed chrisbarber closed 4 years ago

chrisbarber commented 4 years ago

If a resize is pending (load_factor() > max_load_factor()) when serialized, deserialization will fail. This change makes the check for corrupted (incorrectly serialized) max_load_factor less strict, but fixes the issue.

Another option could be to force a rehash before deserializating.

Tessil commented 4 years ago

Hello,

Thank you very much for your contribution, I effectively forgot this edge case.

I fixed a compilation issue with some compilers.