Quick Links: |
Provide hashAppend
for std::pair
.
More...
Namespaces | |
namespace | bslh |
hashAppend
for std::pair
. bslh::hashAppend
, overloaded for the std::pair
class template. Including this function allows for std::pair
types (and types that contain them) to be used as keys in BDE hashed containers. char c = 'a'; short s = static_cast<short>(1);
bslh::DefaultHashAlgorithm hasherS; hasherS(&c, sizeof(char)); hasherS(&s, sizeof(short)); bslh::DefaultHashAlgorithm::result_type hashS = hasherS.computeHash();
std::pair
object. std::pair<char, short> t = std::make_pair(c, s); bslh::DefaultHashAlgorithm hasherT; bslh::hashAppend(hasherT, t); bslh::DefaultHashAlgorithm::result_type hashT = hasherT.computeHash();
assert(hashS == hashT);