From 425c35f2e47e620b9d3940f05818d9e19e66b88e Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 1 Nov 2005 11:01:40 +0000 Subject: 2005-11-01 Paolo Carlini PR libstdc++/24595 * include/tr1/boost_shared_ptr.h (shared_ptr<>::get_deleter): Move out of shared_ptr. * testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/24595.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106321 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/include/tr1/boost_shared_ptr.h | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'libstdc++-v3/include') diff --git a/libstdc++-v3/include/tr1/boost_shared_ptr.h b/libstdc++-v3/include/tr1/boost_shared_ptr.h index 8f95ead7dd5..01250aa107c 100644 --- a/libstdc++-v3/include/tr1/boost_shared_ptr.h +++ b/libstdc++-v3/include/tr1/boost_shared_ptr.h @@ -674,27 +674,20 @@ template _M_refcount.swap(__other._M_refcount); } + void* + _M_get_deleter(const std::type_info& __ti) const + { return _M_refcount.get_deleter(__ti); } + private: template bool _M_less(const shared_ptr<_Tp1>& __rhs) const { return _M_refcount < __rhs._M_refcount; } - void* - _M_get_deleter(const std::type_info& __ti) const - { return _M_refcount.get_deleter(__ti); } - template friend class shared_ptr; template friend class weak_ptr; // friends injected into enclosing namespace and found by ADL: - - // get_deleter (experimental) - template - friend inline _Del* - get_deleter(const shared_ptr& __p) - { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); } - template friend inline bool operator==(const shared_ptr& __a, const shared_ptr<_Tp1>& __b) @@ -752,15 +745,21 @@ template return shared_ptr<_Tp>(__r, __dynamic_cast_tag()); } -// operator<< +// 2.2.3.7 shared_ptr I/O template - std::basic_ostream<_Ch,_Tr>& - operator<<(std::basic_ostream<_Ch,_Tr>& __os, const shared_ptr<_Tp>& __p) + std::basic_ostream<_Ch, _Tr>& + operator<<(std::basic_ostream<_Ch, _Tr>& __os, const shared_ptr<_Tp>& __p) { __os << __p.get(); return __os; } +// 2.2.3.10 shared_ptr get_deleter (experimental) +template + inline _Del* + get_deleter(const shared_ptr<_Tp>& __p) + { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); } + template class weak_ptr -- cgit v1.2.1