Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Add member functions from C++17 #79

Merged
merged 2 commits into from
Jun 26, 2020
Merged

Conversation

k0zmo
Copy link
Contributor

@k0zmo k0zmo commented Jun 25, 2020

Adds try_emplace and insert_or_assign from C++17. Fixes #71.

@k0zmo k0zmo force-pushed the cpp17-api branch 3 times, most recently from 1ae3037 to 0a7d549 Compare June 26, 2020 09:39
@k0zmo
Copy link
Contributor Author

k0zmo commented Jun 26, 2020

How do I please both clang-tidy which wants me to pass the string by value (I agree) and LGTM which wants me to pass the string by const reference?

EDIT: Nevermind

@k0zmo k0zmo force-pushed the cpp17-api branch 2 times, most recently from b3bbee2 to f2951b3 Compare June 26, 2020 12:57
@martinus martinus merged commit 159e53b into martinus:master Jun 26, 2020
@martinus
Copy link
Owner

Pleasing all is a pain, but most of the time its possible...
Again, thanks a lot!

@k0zmo k0zmo deleted the cpp17-api branch June 26, 2020 18:02
@GilesBathgate
Copy link

@martinus Am I correct in understanding that this implementation does a double hash lookup, i.e the lookup in find() and then if not found a repeat lookup in emplace() could it be improved to do the same but with a single lookup?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add insert_or_assign and try_emplace
3 participants