From 81daf4baea6ccb111110831351543bc4676d089d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 13 Nov 2005 12:14:51 +0000 Subject: [PATCH] [multiple changes] 2005-11-13 Jonathan Wakely * include/tr1/boost_shared_ptr.h (get_deleter): Declare before shared_ptr. (shared_ptr<>): Declare get_deleter as friend. (shared_ptr<>:_M_get_deleter): Private. 2005-11-13 Douglas Gregor PR libstdc++/24818 * include/tr1/ref_wrap_iterate.h (reference_wrapper::operator()()): Don't dereferene the result of get() before calling it; it's already a reference. * testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc: Test nullary calls to reference_wrappers. From-SVN: r106863 --- libstdc++-v3/include/tr1/boost_shared_ptr.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/tr1/boost_shared_ptr.h b/libstdc++-v3/include/tr1/boost_shared_ptr.h index ec940a9c25f..cb190191521 100644 --- a/libstdc++-v3/include/tr1/boost_shared_ptr.h +++ b/libstdc++-v3/include/tr1/boost_shared_ptr.h @@ -421,6 +421,9 @@ shared_count::shared_count(const weak_count& __r) // fwd decls +template + class shared_ptr; + template class weak_ptr; @@ -466,6 +469,11 @@ inline void __enable_shared_from_this(const shared_count&, ...) { } + +// get_deleter must be declared before friend declaration by shared_ptr. +template + _Del* get_deleter(const shared_ptr<_Tp>&); + /** * @class shared_ptr * @@ -473,7 +481,6 @@ __enable_shared_from_this(const shared_count&, ...) * The object pointed to is deleted when the last shared_ptr pointing to it * is destroyed or reset. */ - template class shared_ptr { @@ -672,11 +679,11 @@ template _M_refcount.swap(__other._M_refcount); } + private: 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 @@ -685,6 +692,9 @@ template template friend class shared_ptr; template friend class weak_ptr; + template + friend _Del* get_deleter(const shared_ptr<_Tp1>&); + // friends injected into enclosing namespace and found by ADL: template friend inline bool