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

Need a lambda friendly unordered_set like find() #8

Open
craigminihan opened this issue Apr 6, 2015 · 1 comment
Open

Need a lambda friendly unordered_set like find() #8

craigminihan opened this issue Apr 6, 2015 · 1 comment

Comments

@craigminihan
Copy link
Contributor

The std::unordered_set does not support a lambda implementation of find(). This means the template type must be created to get a key comparison. In the key cache case the type is a shared_ptr which is a relatively expensive object. It is much preferred to compare the field count and the hash without the expense of creating a smart pointer instance.

@craigminihan
Copy link
Contributor Author

There is also the nasty side effect that new must be invoked to create the key item in order to do the lookup - mitigated with an ugly shared_ptr null deleter.

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

No branches or pull requests

1 participant