| // Copyright 2012 Daniel James. |
| // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| // This is an example of how to write a hash function for a template |
| #include <boost/functional/hash_fwd.hpp> |
| template <typename A, typename B> |
| my_pair(A const& v1, B const& v2) |
| bool operator==(my_pair const& other) const |
| return value1 == other.value1 && |
| friend std::size_t hash_value(my_pair const& p) |
| ndnboost::hash_combine(seed, p.value1); |
| ndnboost::hash_combine(seed, p.value2); |