diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-13 12:14:51 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-13 12:14:51 +0000 |
commit | 0ab53de2cb1a26cbeeac60f90b4aa4987f422894 (patch) | |
tree | 3bfd8ab9475234b605e3709c5b1d1161b1c0dac8 /libstdc++-v3 | |
parent | 61aa9b00baf02bb77f70de8a5c7f6cdd5f0037ee (diff) | |
download | gcc-0ab53de2cb1a26cbeeac60f90b4aa4987f422894.tar.gz |
2005-11-13 Jonathan Wakely <redi@gcc.gnu.org>
* 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 <doug.gregor@gmail.com>
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106863 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/include/tr1/boost_shared_ptr.h | 14 |
1 files 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 @@ -422,6 +422,9 @@ shared_count::shared_count(const weak_count& __r) // fwd decls template<typename _Tp> + class shared_ptr; + +template<typename _Tp> class weak_ptr; template<typename _Tp> @@ -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<typename _Del, typename _Tp> + _Del* get_deleter(const shared_ptr<_Tp>&); + /** * @class shared_ptr <tr1/memory> * @@ -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<typename _Tp> class shared_ptr { @@ -672,11 +679,11 @@ template<typename _Tp> _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<typename _Tp1> bool _M_less(const shared_ptr<_Tp1>& __rhs) const @@ -685,6 +692,9 @@ template<typename _Tp> template<typename _Tp1> friend class shared_ptr; template<typename _Tp1> friend class weak_ptr; + template<typename _Del, typename _Tp1> + friend _Del* get_deleter(const shared_ptr<_Tp1>&); + // friends injected into enclosing namespace and found by ADL: template<typename _Tp1> friend inline bool |