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

Adding try_emplace to tree23 #1

Open
kurt-krueckeberg opened this issue Apr 22, 2018 · 0 comments
Open

Adding try_emplace to tree23 #1

kurt-krueckeberg opened this issue Apr 22, 2018 · 0 comments
Assignees

Comments

@kurt-krueckeberg
Copy link
Owner

Implementing an emplace method for tree23 would force me to better understand how the use of perfect forwarding combined with a variadic template method allows for in-pace construction of a new node in a tree (map). In-place construction eliminates entirely the creation of a temporary object that then gets moved (via the move constructor) into a new node.

As of C++11 the STL map container class had an emplace() method, the and C++17 version of map added try_emplace().

How is try_emplace implemented? What new feature(s) of C++17 beyond perfect forwarding an variadic class template methods make in-place construction does it use to implement in-place construction via try_emplace() for a map/tree?

@kurt-krueckeberg kurt-krueckeberg self-assigned this Apr 22, 2018
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