Skip to content

Conversation

@brian-kelley
Copy link
Contributor

@brian-kelley brian-kelley commented Jan 8, 2026

  • Fixed capacity: The capacity of the unordered_map is fixed when inside a parallel algorithm.
    This means that an insert can fail when the capacity of the map is exceeded.

This sentence in the page for UnorderedMap seems to imply that the only reason insert(key) might fail is because the capacity is exceeded. A user could then think that an empty map with capacity N can always have N unique keys inserted without failures, but this actually does fail often in practice.

Near the bottom, the breakdown of UnorderedMapInsertResult does explain this but I think it's useful to say it at the top too.

Signed-off-by: Brian Kelley <bmkelle@sandia.gov>
Copy link
Contributor

@JBludau JBludau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, for this. I was also thinking about this but you were faster. If you agree with my comment, are you fine with me pushing to your branch?

@brian-kelley
Copy link
Contributor Author

@JBludau This version looks good to me.

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

Successfully merging this pull request may close these issues.

2 participants