diff --git a/include/boost/container_hash/extensions.hpp b/include/boost/container_hash/extensions.hpp index 94adfa5..cc1a421 100644 --- a/include/boost/container_hash/extensions.hpp +++ b/include/boost/container_hash/extensions.hpp @@ -26,10 +26,6 @@ # include #endif -#if !defined(BOOST_NO_CXX11_SMART_PTR) -# include -#endif - namespace boost { #if !defined(BOOST_NO_CXX11_HDR_TUPLE) @@ -134,18 +130,6 @@ namespace boost #endif -#endif - -#if !defined(BOOST_NO_CXX11_SMART_PTR) - template - inline std::size_t hash_value(std::shared_ptr const& x) { - return boost::hash_value(x.get()); - } - - template - inline std::size_t hash_value(std::unique_ptr const& x) { - return boost::hash_value(x.get()); - } #endif // diff --git a/include/boost/container_hash/hash.hpp b/include/boost/container_hash/hash.hpp index 4ab436b..c4ba130 100644 --- a/include/boost/container_hash/hash.hpp +++ b/include/boost/container_hash/hash.hpp @@ -34,6 +34,10 @@ #include #include +#if !defined(BOOST_NO_CXX11_SMART_PTR) +# include +#endif + #if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX) #include #endif @@ -244,6 +248,24 @@ namespace boost return boost::hash_unordered_range( v.begin(), v.end() ); } +#endif + + // std::unique_ptr, std::shared_ptr + +#if !defined(BOOST_NO_CXX11_SMART_PTR) + + template + std::size_t hash_value( std::shared_ptr const& x ) + { + return boost::hash_value( x.get() ); + } + + template + std::size_t hash_value( std::unique_ptr const& x ) + { + return boost::hash_value( x.get() ); + } + #endif // std::type_index