Skip to content

Makes non-const iterator values mutable#55

Open
howsohazard wants to merge 1 commit into
Tessil:masterfrom
howsohazard:mutable-iterator-values
Open

Makes non-const iterator values mutable#55
howsohazard wants to merge 1 commit into
Tessil:masterfrom
howsohazard:mutable-iterator-values

Conversation

@howsohazard

Copy link
Copy Markdown

This allows for usage patterns like:

auto iter = map.find(key);
iter->second = new_value;

while respecting that const_iterator cannot update that value.

@tkhyn

tkhyn commented Jul 13, 2026

Copy link
Copy Markdown

Thanks a lot for this fix, I bumped into this issue as well... Definitely preferring this over const_cast-ing results 😊

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