Fix hash overloads for integral types
authorOgnjen Dragoljevic <plamenko@fb.com>
Mon, 16 Oct 2017 14:24:15 +0000 (07:24 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 16 Oct 2017 14:44:38 +0000 (07:44 -0700)
commit4e2b0bb9a93dfd83b9dd74899463c2da5b33ab54
treefe23737e849022bf6284079558e224d5364b33c0
parentb02d434889ac7e937aaf01b1e601c76aa119640e
Fix hash overloads for integral types

Summary:
`folly/Hash.h:379:12: error: implicit instantiation of undefined template 'folly::hasher<unsigned long, void>'`
So, folly is unable to hash the very type it returns: `size_t`. Namely, folly has overloads for `uint32_t` and `uint64_t` which on my Mac map to `int` and `long long` respectively. `size_t` on the other hand maps to `long` which is neither.
Rather than overloading library types (which are just typedefs), we should overload all the built-in types: `char`, `short`, `int`, `long`, `long long`, `signed` and `unsigned` variants (with special treatment of `char`).

Reviewed By: yfeldblum, luciang

Differential Revision: D6051600

fbshipit-source-id: d59569dab963cbe0329aa589ff321cfb22308193
folly/Hash.h
folly/test/HashTest.cpp