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

Add * and -> operators to Hashmap iterator #2479

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Feb 6, 2022

This PR enables more natural use of iteration:

HashMap<int, String> map;
map[0] = "abc";'
map[2] = "def";
for(auto entry: map) {
  Serial.println(*entry); // Previously had to use entry->value()
  Serial.println(entry->length()); // entry->value().length();
}

@mikee47 mikee47 changed the title Add * and -> Hashmap operators for easier iteration Add * and -> operators to Hashmap iterator Feb 6, 2022
@slaff slaff added this to the 4.6.0 milestone Feb 7, 2022
@slaff slaff merged commit 4d3647d into SmingHub:develop Feb 8, 2022
@mikee47 mikee47 deleted the feature/hashmap-operators branch February 10, 2022 21:09
@slaff slaff mentioned this pull request Feb 25, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants