Reference-counting helpers - Clean-up
This commit is contained in:
parent
270da6492a
commit
5f3911a067
2 changed files with 14 additions and 12 deletions
|
@ -162,18 +162,7 @@ class T_RcPtr
|
|||
};
|
||||
|
||||
template< typename T >
|
||||
void swap( T_RcPtr< T >& lhs , T_RcPtr< T >& rhs ) noexcept;
|
||||
|
||||
template< typename T >
|
||||
inline T_RcPtr< T > T_RcPtr< T >::FromRaw(
|
||||
T* ptr ) noexcept
|
||||
{
|
||||
assert( ptr->getReferenceCount( ) == 0 );
|
||||
T_RcPtr< T > rv;
|
||||
ptr->increaseReferences_( );
|
||||
rv.target_ = ptr;
|
||||
return rv;
|
||||
}
|
||||
void swap( T_RcPtr< T >& lhs , T_RcPtr< T >& rhs ) noexcept;
|
||||
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -47,6 +47,8 @@ inline T_RcPtr< T >::~T_RcPtr( ) noexcept
|
|||
clear( );
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
template< typename T >
|
||||
template< typename... AT >
|
||||
inline T_RcPtr< T > T_RcPtr< T >::New(
|
||||
|
@ -58,6 +60,17 @@ inline T_RcPtr< T > T_RcPtr< T >::New(
|
|||
return ptr;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
inline T_RcPtr< T > T_RcPtr< T >::FromRaw(
|
||||
T* ptr ) noexcept
|
||||
{
|
||||
assert( ptr->getReferenceCount( ) == 0 );
|
||||
T_RcPtr< T > rv;
|
||||
ptr->increaseReferences_( );
|
||||
rv.target_ = ptr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
template< typename T >
|
||||
|
|
Loading…
Reference in a new issue