Add hash_value for shared_ptr; prevents hash_value( bool ) from being used. Refs #5216.

[SVN r69260]
This commit is contained in:
Peter Dimov
2011-02-24 23:24:54 +00:00
parent e3d2f2ee6b
commit 69aa01ec00
3 changed files with 46 additions and 1 deletions
+11 -1
View File
@@ -41,6 +41,7 @@
#include <algorithm> // for std::swap
#include <functional> // for std::less
#include <typeinfo> // for std::bad_cast
#include <cstddef> // for std::size_t
#if !defined(BOOST_NO_IOSTREAM)
#if !defined(BOOST_NO_IOSFWD)
@@ -722,7 +723,16 @@ template<class T> inline bool atomic_compare_exchange_explicit( shared_ptr<T> *
return atomic_compare_exchange( p, v, w ); // std::move( w )
}
#endif
#endif // !defined(BOOST_SP_NO_ATOMIC_ACCESS)
// hash_value
template< class T > struct hash;
template< class T > std::size_t hash_value( boost::shared_ptr<T> const & p )
{
return boost::hash< T* >()( p.get() );
}
} // namespace boost