Commit 0f88f1f2 by Jonathan Wakely Committed by Jonathan Wakely

Use shared_ptr<T>::element_type in hash specializations

	* include/bits/shared_ptr.h (hash<shared_ptr<T>>): Use element_type.
	* include/bits/shared_ptr_base.h (hash<__shared_ptr<T, L>>): Likewise.

From-SVN: r242333
parent 9eb97e61
2016-11-11 Jonathan Wakely <jwakely@redhat.com>
* include/bits/shared_ptr.h (hash<shared_ptr<T>>): Use element_type.
* include/bits/shared_ptr_base.h (hash<__shared_ptr<T, L>>): Likewise.
2016-11-10 François Dumont <fdumont@gcc.gnu.org> 2016-11-10 François Dumont <fdumont@gcc.gnu.org>
* src/c++11/debug.cc (format_word): Delete. * src/c++11/debug.cc (format_word): Delete.
......
...@@ -692,7 +692,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -692,7 +692,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
size_t size_t
operator()(const shared_ptr<_Tp>& __s) const noexcept operator()(const shared_ptr<_Tp>& __s) const noexcept
{ return std::hash<_Tp*>()(__s.get()); } {
return std::hash<typename shared_ptr<_Tp>::element_type*>()(__s.get());
}
}; };
// @} group pointer_abstractions // @} group pointer_abstractions
......
...@@ -1681,7 +1681,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1681,7 +1681,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
size_t size_t
operator()(const __shared_ptr<_Tp, _Lp>& __s) const noexcept operator()(const __shared_ptr<_Tp, _Lp>& __s) const noexcept
{ return std::hash<_Tp*>()(__s.get()); } {
return hash<typename __shared_ptr<_Tp, _Lp>::element_type*>()(
__s.get());
}
}; };
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment