util: specialize std::hash<> for ethernet::Address
Change-Id: Id1263b8716d242f36e563b9aebbd2bb695fd4e5b
diff --git a/src/util/ethernet.cpp b/src/util/ethernet.cpp
index ae52005..34420b3 100644
--- a/src/util/ethernet.cpp
+++ b/src/util/ethernet.cpp
@@ -27,6 +27,8 @@
#include "ethernet.hpp"
+#include <boost/functional/hash.hpp>
+
#include <cstdio>
#include <ostream>
@@ -137,3 +139,12 @@
} // namespace ethernet
} // namespace util
} // namespace ndn
+
+
+using ndn::util::ethernet::Address;
+
+std::size_t
+std::hash<Address>::operator()(const Address& a) const noexcept
+{
+ return boost::hash_range(a.cbegin(), a.cend());
+}