BDE 4.14.0 Production release
|
Provide hashAppend
for std::pair
.
This component provides a free function template, 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.
This section illustrates intended usage of this component.
Suppose one must compute has that combines the hashes of several integer values, each of a different type:
First, we can make that calculation by repeated invocations of a 'bslh::DefaultHashAlogorithm object:
Now, the same calculation can also be be made if those same values are contained in a single std::pair
object.
Finally, we confirm that we computed the same result.