BPHash
General object hashing library for C++
utility.hpp
Go to the documentation of this file.
1 /*! \file
2  * \brief Hashing of std::pair
3  */
4 
5 /* Copyright (c) 2016 Benjamin Pritchard <ben@bennyp.org>
6  * This file is part of the BPHash project, which is released
7  * under the BSD 3-clause license. See the LICENSE file for details
8  */
9 
10 #pragma once
11 
12 #include "bphash/Hasher.hpp"
13 #include <utility>
14 
15 namespace bphash {
16 
17 /*! \brief Hashing of std::pair */
18 template<typename T1, typename T2>
19 typename std::enable_if<is_hashable<T1, T2>::value, void>::type
20 hash_object( const std::pair<T1, T2> & p, Hasher & h)
21 {
22  h(p.first, p.second);
23 }
24 
25 
26 } // close namespace bphash
27 
std::enable_if< is_hashable< T >::value, void >::type hash_object(const std::array< T, N > &a, Hasher &h)
Hashing of std::array.
Definition: array.hpp:20
A class that hashes objects (header)
Class that is used to hash objects.
Definition: Hasher.hpp:78