Hash: Merge support for smart pointers.

[SVN r79548]
This commit is contained in:
Daniel James
2012-07-16 00:18:30 +00:00
parent 3306443ea8
commit b528d3b1bf
4 changed files with 107 additions and 0 deletions
@@ -38,4 +38,18 @@ namespace std {
# endif
#endif
// std::shared_ptr/std::unique_ptr
#if !defined(BOOST_NO_CXX11_HDR_MEMORY)
# if (defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
!defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD))
# include <memory>
# else
namespace std {
template <class> class shared_ptr;
template <class, class> class unique_ptr;
}
# endif
#endif
#endif
@@ -177,6 +177,18 @@ namespace boost
# undef BOOST_HASH_TUPLE_F
#endif
#endif
#if !defined(BOOST_NO_CXX11_SMART_PTR)
template <typename T>
inline std::size_t hash_value(std::shared_ptr<T> const& x) {
return boost::hash_value(x.get());
}
template <typename T, typename Deleter>
inline std::size_t hash_value(std::unique_ptr<T, Deleter> const& x) {
return boost::hash_value(x.get());
}
#endif
//