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

11.26: Return type is a reference #37

Open
xjay73 opened this issue Jul 11, 2021 · 0 comments
Open

11.26: Return type is a reference #37

xjay73 opened this issue Jul 11, 2021 · 0 comments

Comments

@xjay73
Copy link

xjay73 commented Jul 11, 2021

The return type from the subscript operator is not mapped_type. It is mapped_type&, which is what allows an expression like ++word_count[word] to increment the mapped value of the element within the map instead of only incrementing a temporary copy of it.

@xjay73 xjay73 changed the title 11.26: Return type is a incorrect 11.26: Return type is a reference Jul 11, 2021
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

No branches or pull requests

1 participant