From 2c149ff8b1689aae922f3a0d6b61b190c6618088 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Fri, 8 Feb 2019 08:38:18 +0800 Subject: [PATCH] add IntrusivePtr<>::Reset minor --- src/core/IntrusivePtr.hpp | 5 +++++ src/math/scalar.hpp | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/IntrusivePtr.hpp b/src/core/IntrusivePtr.hpp index 11b78b1c..004c5ec6 100644 --- a/src/core/IntrusivePtr.hpp +++ b/src/core/IntrusivePtr.hpp @@ -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_); diff --git a/src/math/scalar.hpp b/src/math/scalar.hpp index d32eb8ba..1d6ec463 100644 --- a/src/math/scalar.hpp +++ b/src/math/scalar.hpp @@ -22,12 +22,6 @@ #include "constants.hpp" #include -#if _MSC_VER >= 1900 -# define E2D_CONSTEXPR constexpr -#else -# define E2D_CONSTEXPR const -#endif - namespace easy2d {