Reference-counting helpers - Swap

This commit is contained in:
Emmanuel BENOîT 2019-01-02 16:51:18 +01:00
parent ddaa46867d
commit 8e2c773de1
2 changed files with 25 additions and 0 deletions
include/ebcl/inline

View file

@ -223,6 +223,23 @@ template<
/*----------------------------------------------------------------------------*/
template< typename T >
inline T_RcPtr< T > T_RcPtr< T >::swap(
T_RcPtr< T >& other ) noexcept
{
std::swap( target_ , other.target_ );
return *this;
}
template< typename T >
inline void swap( T_RcPtr< T >& lhs ,
T_RcPtr< T >& rhs ) noexcept
{
lhs.swap( rhs );
}
/*----------------------------------------------------------------------------*/
template< typename T >
inline T_RcPtr< T >::operator bool ( ) const noexcept
{