From 4e687216b7b86d60752a45136ce71498080e589e Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Mon, 26 Aug 2002 17:10:28 +0000 Subject: [PATCH] added more specializations of hash [SVN r15103] --- include/boost/graph/detail/adjacency_list.hpp | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/include/boost/graph/detail/adjacency_list.hpp b/include/boost/graph/detail/adjacency_list.hpp index ae0a1c9f..5c243255 100644 --- a/include/boost/graph/detail/adjacency_list.hpp +++ b/include/boost/graph/detail/adjacency_list.hpp @@ -2508,14 +2508,43 @@ namespace boost { #if !defined(BOOST_NO_HASH) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) namespace BOOST_STD_EXTENSION_NAMESPACE { - template - struct hash< boost::detail::stored_edge_property > + template <> + struct hash< void* > // Need this when vertex_descriptor=void* { - std::size_t operator()(const boost::detail::stored_edge_property& e) const + std::size_t + operator()(void* v) const { return (std::size_t)v; } + }; + + template + struct hash< boost::detail::stored_edge > + { + std::size_t + operator()(const boost::detail::stored_edge& e) const { return hash()(e.m_target); } }; + + template + struct hash< boost::detail::stored_edge_property > + { + std::size_t + operator()(const boost::detail::stored_edge_property& e) const + { + return hash()(e.m_target); + } + }; + + template + struct hash< boost::detail::stored_edge_iter > + { + std::size_t + operator()(const boost::detail::stored_edge_iter& e) const + { + return hash()(e.m_target); + } + }; + } #endif