CppCon 2014 has ended
Thursday, September 11 • 4:45pm - 5:45pm
Types Don't Know #

Log in to save this to your schedule, view media, leave feedback and see who's attending!

This presentation will be based on the following paper which will be a proposal to the C++ standards committee:


This paper proposes a new hashing infrastructure that completely decouples hashing algorithms from individual types that need to be hashed. This decoupling divides the hashing computation among 3 different programmers who need not coordinate with each other:

1. Authors of hashable types (keys of type K) write their hashing support just once, using no specific hashing algorithm. This code resembles (and is approximately the same amount of work as) operator== and swap for a type.

2. Authors of hashing algorithms write a functor (e.g. H) that operates on a contiguous chunk of generic memory, represented by a void const* and a number of bytes. This code has no concept of a specific key type, only of bytes to be hashed.

3. Clients who want to hash keys of type K using hashing algorithm H will form a functor of type std::uhash to give to an unordered container.

unordered_set my_set;

Source code will be available at this link: https://github.com/HowardHinnant/hash_append

avatar for Howard Hinnant

Howard Hinnant

Senior Software Engineer, Ripple
Lead author of several C++11 features including: move semantics, unique_ptr and . Lead author on three open source projects: A std::lib implementation: http://libcxx.llvm.org An Itanium ABI implementation: http://libcxxabi.llvm.org A date/time/timezone library: https://git... Read More →

Thursday September 11, 2014 4:45pm - 5:45pm PDT

Attendees (0)