mirror of git://gcc.gnu.org/git/gcc.git
boost_shared_ptr.h: Trivial formatting fixes.
2006-09-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/boost_shared_ptr.h: Trivial formatting fixes. From-SVN: r117145
This commit is contained in:
parent
53e3e587a9
commit
459f9f82ec
|
|
@ -1,3 +1,7 @@
|
|||
2006-09-22 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/tr1/boost_shared_ptr.h: Trivial formatting fixes.
|
||||
|
||||
2006-09-21 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* include/ext/type_traits.h (__numeric_traits_integer): New.
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ class bad_weak_ptr : public std::exception
|
|||
{
|
||||
public:
|
||||
virtual char const*
|
||||
what() const throw() { return "tr1::bad_weak_ptr"; }
|
||||
what() const throw()
|
||||
{ return "tr1::bad_weak_ptr"; }
|
||||
};
|
||||
|
||||
// Substitute for bad_weak_ptr object in the case of -fno-exceptions.
|
||||
|
|
@ -102,7 +103,6 @@ template<>
|
|||
class _Mutex_base<_S_mutex> : public __gnu_cxx::__mutex
|
||||
{ };
|
||||
|
||||
|
||||
template<_Lock_policy _Lp = __default_lock_policy>
|
||||
class _Sp_counted_base : public _Mutex_base<_Lp>
|
||||
{
|
||||
|
|
@ -217,7 +217,8 @@ template<>
|
|||
// Replace the current counter value with the old value + 1, as
|
||||
// long as it's not changed meanwhile.
|
||||
}
|
||||
while (!__sync_bool_compare_and_swap(&_M_use_count, __count, __count + 1));
|
||||
while (!__sync_bool_compare_and_swap(&_M_use_count, __count,
|
||||
__count + 1));
|
||||
}
|
||||
|
||||
template<typename _Ptr, typename _Deleter, _Lock_policy _Lp>
|
||||
|
|
@ -278,7 +279,8 @@ template<_Lock_policy _Lp = __default_lock_policy>
|
|||
|
||||
// Special case for auto_ptr<_Tp> to provide the strong guarantee.
|
||||
template<typename _Tp>
|
||||
explicit shared_count(std::auto_ptr<_Tp>& __r)
|
||||
explicit
|
||||
shared_count(std::auto_ptr<_Tp>& __r)
|
||||
: _M_pi(new _Sp_counted_base_impl<_Tp*,
|
||||
_Sp_deleter<_Tp>, _Lp >(__r.get(), _Sp_deleter<_Tp>()))
|
||||
{ __r.release(); }
|
||||
|
|
@ -314,7 +316,8 @@ template<_Lock_policy _Lp = __default_lock_policy>
|
|||
return *this;
|
||||
}
|
||||
|
||||
void swap(shared_count& __r) // nothrow
|
||||
void
|
||||
swap(shared_count& __r) // nothrow
|
||||
{
|
||||
_Sp_counted_base<_Lp>* __tmp = __r._M_pi;
|
||||
__r._M_pi = _M_pi;
|
||||
|
|
@ -422,7 +425,8 @@ template<_Lock_policy _Lp>
|
|||
|
||||
template<_Lock_policy _Lp>
|
||||
inline
|
||||
shared_count<_Lp>::shared_count(const weak_count<_Lp>& __r)
|
||||
shared_count<_Lp>::
|
||||
shared_count(const weak_count<_Lp>& __r)
|
||||
: _M_pi(__r._M_pi)
|
||||
{
|
||||
if (_M_pi != 0)
|
||||
|
|
@ -448,24 +452,24 @@ struct __dynamic_cast_tag { };
|
|||
struct __polymorphic_cast_tag { };
|
||||
|
||||
template<class _Tp>
|
||||
struct shared_ptr_traits
|
||||
{ typedef _Tp& reference; };
|
||||
struct __shared_ptr_reference
|
||||
{ typedef _Tp& __type; };
|
||||
|
||||
template<>
|
||||
struct shared_ptr_traits<void>
|
||||
{ typedef void reference; };
|
||||
struct __shared_ptr_reference<void>
|
||||
{ typedef void __type; };
|
||||
|
||||
template<>
|
||||
struct shared_ptr_traits<void const>
|
||||
{ typedef void reference; };
|
||||
struct __shared_ptr_reference<void const>
|
||||
{ typedef void __type; };
|
||||
|
||||
template<>
|
||||
struct shared_ptr_traits<void volatile>
|
||||
{ typedef void reference; };
|
||||
struct __shared_ptr_reference<void volatile>
|
||||
{ typedef void __type; };
|
||||
|
||||
template<>
|
||||
struct shared_ptr_traits<void const volatile>
|
||||
{ typedef void reference; };
|
||||
struct __shared_ptr_reference<void const volatile>
|
||||
{ typedef void __type; };
|
||||
|
||||
|
||||
// Support for enable_shared_from_this.
|
||||
|
|
@ -474,8 +478,8 @@ template<>
|
|||
template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
|
||||
void
|
||||
__enable_shared_from_this_helper(const shared_count<_Lp>&,
|
||||
const __enable_shared_from_this<_Tp1, _Lp>*,
|
||||
const _Tp2*);
|
||||
const __enable_shared_from_this<_Tp1,
|
||||
_Lp>*, const _Tp2*);
|
||||
|
||||
template<_Lock_policy _Lp>
|
||||
inline void
|
||||
|
|
@ -487,13 +491,13 @@ template<_Lock_policy _Lp>
|
|||
* @class shared_ptr <tr1/memory>
|
||||
*
|
||||
* A smart pointer with reference-counted copy semantics.
|
||||
* The object pointed to is deleted when the last shared_ptr pointing to it
|
||||
* is destroyed or reset.
|
||||
* The object pointed to is deleted when the last shared_ptr pointing to
|
||||
* it is destroyed or reset.
|
||||
*/
|
||||
template<typename _Tp, _Lock_policy _Lp>
|
||||
class __shared_ptr
|
||||
{
|
||||
typedef typename shared_ptr_traits<_Tp>::reference _Reference;
|
||||
typedef typename __shared_ptr_reference<_Tp>::__type _Reference;
|
||||
|
||||
public:
|
||||
typedef _Tp element_type;
|
||||
|
|
@ -511,7 +515,8 @@ template<typename _Tp, _Lock_policy _Lp>
|
|||
* @throw std::bad_alloc, in which case @c delete @a p is called.
|
||||
*/
|
||||
template<typename _Tp1>
|
||||
explicit __shared_ptr(_Tp1* __p)
|
||||
explicit
|
||||
__shared_ptr(_Tp1* __p)
|
||||
: _M_ptr(__p), _M_refcount(__p, _Sp_deleter<_Tp1>())
|
||||
{
|
||||
__glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
|
||||
|
|
@ -542,8 +547,9 @@ template<typename _Tp, _Lock_policy _Lp>
|
|||
|
||||
// generated copy constructor, assignment, destructor are fine.
|
||||
|
||||
/** @brief If @a r is empty, constructs an empty %__shared_ptr; otherwise
|
||||
* construct a %__shared_ptr that shares ownership with @a r.
|
||||
/** @brief If @a r is empty, constructs an empty %__shared_ptr;
|
||||
* otherwise construct a %__shared_ptr that shares ownership
|
||||
* with @a r.
|
||||
* @param r A %__shared_ptr.
|
||||
* @post get() == r.get() && use_count() == r.use_count()
|
||||
* @throw std::bad_alloc, in which case
|
||||
|
|
@ -561,7 +567,8 @@ template<typename _Tp, _Lock_policy _Lp>
|
|||
* in which case the constructor has no effect.
|
||||
*/
|
||||
template<typename _Tp1>
|
||||
explicit __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
|
||||
explicit
|
||||
__shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
|
||||
: _M_refcount(__r._M_refcount) // may throw
|
||||
{
|
||||
__glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
|
||||
|
|
@ -574,7 +581,8 @@ template<typename _Tp, _Lock_policy _Lp>
|
|||
* @post use_count() == 1 and r.get() == 0
|
||||
*/
|
||||
template<typename _Tp1>
|
||||
explicit __shared_ptr(std::auto_ptr<_Tp1>& __r)
|
||||
explicit
|
||||
__shared_ptr(std::auto_ptr<_Tp1>& __r)
|
||||
: _M_ptr(__r.get()), _M_refcount()
|
||||
{
|
||||
// TODO requires r.release() convertible to _Tp*, Tp1 is complete,
|
||||
|
|
@ -1001,7 +1009,8 @@ template<typename _Tp>
|
|||
shared_ptr() : __shared_ptr<_Tp>() { }
|
||||
|
||||
template<typename _Tp1>
|
||||
explicit shared_ptr(_Tp1* __p)
|
||||
explicit
|
||||
shared_ptr(_Tp1* __p)
|
||||
: __shared_ptr<_Tp>(__p) { }
|
||||
|
||||
template<typename _Tp1, typename _Deleter>
|
||||
|
|
@ -1013,11 +1022,13 @@ template<typename _Tp>
|
|||
: __shared_ptr<_Tp>(__r) { }
|
||||
|
||||
template<typename _Tp1>
|
||||
explicit shared_ptr(const __weak_ptr<_Tp1>& __r)
|
||||
explicit
|
||||
shared_ptr(const __weak_ptr<_Tp1>& __r)
|
||||
: __shared_ptr<_Tp>(__r) { }
|
||||
|
||||
template<typename _Tp1>
|
||||
explicit shared_ptr(std::auto_ptr<_Tp1>& __r)
|
||||
explicit
|
||||
shared_ptr(std::auto_ptr<_Tp1>& __r)
|
||||
: __shared_ptr<_Tp>(__r) { }
|
||||
|
||||
template<typename _Tp1>
|
||||
|
|
|
|||
Loading…
Reference in New Issue