Skip to content

Added hash implementation for std::pair (from the web)#30

Merged
dan1994 merged 1 commit intodevelopfrom
feature/29-implement-hashing-for-std__pair
Oct 16, 2019
Merged

Added hash implementation for std::pair (from the web)#30
dan1994 merged 1 commit intodevelopfrom
feature/29-implement-hashing-for-std__pair

Conversation

@dan1994
Copy link
Copy Markdown
Owner

@dan1994 dan1994 commented Oct 16, 2019

Closes #29

@dan1994 dan1994 self-assigned this Oct 16, 2019
@dan1994 dan1994 merged commit 53d5215 into develop Oct 16, 2019
@dan1994 dan1994 deleted the feature/29-implement-hashing-for-std__pair branch October 16, 2019 07:01
@Roynecro97
Copy link
Copy Markdown

Roynecro97 commented Oct 17, 2019

I know this is already merged, but the hash is very weak, all pairs with first == second will have a hash of 0. I think that returning the hash on the concatenation of the hashes on the members of the pair might be better. (Of course it will not be better performance wise)

@dan1994
Copy link
Copy Markdown
Owner Author

dan1994 commented Oct 17, 2019

I actually noticed that, when I went over it later, and your comment is correct of course.
I'll open an issue to fix that (correctness before performance).

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.

Implement hashing for std::pair

2 participants