Skip to content

hashmap each should be pure #3372

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

Closed
jesse99 opened this issue Sep 4, 2012 · 4 comments
Closed

hashmap each should be pure #3372

jesse99 opened this issue Sep 4, 2012 · 4 comments
Assignees
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@jesse99
Copy link
Contributor

jesse99 commented Sep 4, 2012

I have an impl of BaseIter which needs to call each on a hashmap, but I can't because the hashmap's each is not pure.

Not sure how to work around this other than not using BaseIter which isn't very cool.

@jesse99
Copy link
Contributor Author

jesse99 commented Sep 5, 2012

Work around is to use an unchecked block.

@jesse99
Copy link
Contributor Author

jesse99 commented Sep 5, 2012

hashmap.size and probably others should also be pure.

@ghost ghost assigned nikomatsakis Sep 13, 2012
@graydon
Copy link
Contributor

graydon commented Sep 13, 2012

Niko has some thoughts on whether or not to do this, and how, I believe; purity of iteration over containers is something at least I know he's done some design work on. I was going to suggest his newer core::send_map (which will likely take the place of std::map) but it seems iteration is impure there too.

@jesse99
Copy link
Contributor Author

jesse99 commented Nov 17, 2012

It's pure in master now.

@jesse99 jesse99 closed this as completed Nov 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants