Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make hash_combine accept a configurable hash function
Summary: std::hash is not awesome and not configurable. Typical cases you might want to customize are: string: I happen to know that fnv isn't super awesome, for example, and that's what folly uses for std::hash fbstring. pointers: you may want to hash the contents of the pointer instead of the address for certain types. This is a very simple diff that lets you do that. It provides StdHasher that passes through to std::hash and uses that for hash_combine, so this should be 100% backward compatible. Test Plan: test_hash. I will add another test for using a hasher besides StdHasher shortly. Reviewed By: delong.j@fb.com FB internal diff: D733899
- Loading branch information
Showing
2 changed files
with
75 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters