add IntrusivePtr<>::Reset

minor
This commit is contained in:
Nomango 2019-02-08 08:38:18 +08:00 committed by Nomango
parent 55f28806c9
commit 2c149ff8b1
2 changed files with 5 additions and 6 deletions

View File

@ -67,6 +67,11 @@ namespace easy2d
inline Type* Get() const E2D_NOEXCEPT { return ptr_; }
inline void Reset() E2D_NOEXCEPT
{
IntrusivePtr{}.Swap(*this);
}
inline void Swap(IntrusivePtr& other) E2D_NOEXCEPT
{
std::swap(ptr_, other.ptr_);

View File

@ -22,12 +22,6 @@
#include "constants.hpp"
#include <cmath>
#if _MSC_VER >= 1900
# define E2D_CONSTEXPR constexpr
#else
# define E2D_CONSTEXPR const
#endif
namespace easy2d
{