[multiple changes]
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. From-SVN: r106863
This commit is contained in:
parent
3270a66b55
commit
81daf4baea
|
@ -421,6 +421,9 @@ shared_count::shared_count(const weak_count& __r)
|
||||||
|
|
||||||
|
|
||||||
// fwd decls
|
// fwd decls
|
||||||
|
template<typename _Tp>
|
||||||
|
class shared_ptr;
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
class weak_ptr;
|
class weak_ptr;
|
||||||
|
|
||||||
|
@ -466,6 +469,11 @@ inline void
|
||||||
__enable_shared_from_this(const shared_count&, ...)
|
__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>
|
* @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
|
* The object pointed to is deleted when the last shared_ptr pointing to it
|
||||||
* is destroyed or reset.
|
* is destroyed or reset.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
class shared_ptr
|
class shared_ptr
|
||||||
{
|
{
|
||||||
|
@ -672,11 +679,11 @@ template<typename _Tp>
|
||||||
_M_refcount.swap(__other._M_refcount);
|
_M_refcount.swap(__other._M_refcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
void*
|
void*
|
||||||
_M_get_deleter(const std::type_info& __ti) const
|
_M_get_deleter(const std::type_info& __ti) const
|
||||||
{ return _M_refcount.get_deleter(__ti); }
|
{ return _M_refcount.get_deleter(__ti); }
|
||||||
|
|
||||||
private:
|
|
||||||
template<typename _Tp1>
|
template<typename _Tp1>
|
||||||
bool
|
bool
|
||||||
_M_less(const shared_ptr<_Tp1>& __rhs) const
|
_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 shared_ptr;
|
||||||
template<typename _Tp1> friend class weak_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:
|
// friends injected into enclosing namespace and found by ADL:
|
||||||
template<typename _Tp1>
|
template<typename _Tp1>
|
||||||
friend inline bool
|
friend inline bool
|
||||||
|
|
Loading…
Reference in New Issue