Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Debugflag to enable iterator stability error check #63

Open
martinus opened this issue Mar 10, 2020 · 0 comments
Open

Debugflag to enable iterator stability error check #63

martinus opened this issue Mar 10, 2020 · 0 comments

Comments

@martinus
Copy link
Owner

martinus commented Mar 10, 2020

Add a define that enables error checking in robin_hood map, to check for invalid uses of iteratos after map/set is modified. This is mostly for debugging.

  • Add a flag ROBIN_HOOD_ITERATOR_STABILITY_CHECK or something like that which enables/disables this code part:
    • Add counter member variable to robin_hood (initialized e.g. with a random number or just zero)
    • Counter is increased whenever the map is modified
    • All iterators get this counter when counter
    • accessing the iterator checks if the iterator's counter is the same as the map's counter, throws an exception otherwise

Thanks John for suggesting this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant