• Ognjen Dragoljevic's avatar
    Fix hash overloads for integral types · 4e2b0bb9
    Ognjen Dragoljevic authored
    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
    4e2b0bb9
HashTest.cpp 13.5 KB