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

Extend map with referring insertion #60142

Closed
wants to merge 1 commit into from

Commits on Apr 20, 2019

  1. Extend map with referring insertion

    The motivation for this is that after inserting an association into map, it becomes impossible to do anything else to either key or the value, because the ownership is transferred to the map. It also is impossible to acquire these references without costly workarounds using the current API. There is a question on StackOverflow providing an extended discussion on the matter: https://stackoverflow.com/q/32401857/485115.
    
    Please notice that the implementation of the `insert_and_get_mut_key_value` function might not be optimal and requires further review.
    
    The names of the functions are absolutely up for discussion.
    nikita-volkov committed Apr 20, 2019
    Configuration menu
    Copy the full SHA
    80683e3 View commit details
    Browse the repository at this point in the history