Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashmap erase does not take an iterator #466

Open
redorav opened this issue Apr 8, 2022 · 2 comments
Open

hashmap erase does not take an iterator #466

redorav opened this issue Apr 8, 2022 · 2 comments

Comments

@redorav
Copy link

redorav commented Apr 8, 2022

It only takes a const_iterator, but it should be able to take both.

https://en.cppreference.com/w/cpp/container/unordered_map/erase

@StArBoY-Works
Copy link

Can you explain more what exactly you want to say??

@redorav
Copy link
Author

redorav commented Nov 13, 2023

Yeah, what I mean is that you should be able to call myHashmap.erase(iter) with an iterator you obtained by calling find(), but instead I have to cast it to const_iter because the non-const function doesn't exist. It's a minor API annoyance but I thought I'd create an issue for it

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

No branches or pull requests

3 participants