File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
Modules/Core/Common/include Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,8 @@ class SmartPointer
5656 template <typename T>
5757 using EnableIfConvertible = typename std::enable_if<std::is_convertible<T *, TObjectType *>::value>;
5858
59- /* * Constructor */
60- constexpr SmartPointer () noexcept
61- : m_Pointer(nullptr )
62- {}
59+ /* * Default-constructor */
60+ constexpr SmartPointer () noexcept = default;
6361
6462 /* * Copy constructor */
6563 SmartPointer (const SmartPointer & p) noexcept
@@ -68,9 +66,8 @@ class SmartPointer
6866 this ->Register ();
6967 }
7068
71- constexpr SmartPointer (std::nullptr_t p) noexcept
72- : m_Pointer(p)
73- {}
69+ /* * Constructor for implicit conversion from nullptr */
70+ constexpr SmartPointer (std::nullptr_t ) noexcept {}
7471
7572 /* * constructor with implicit conversion of pointer type */
7673 template <typename T, typename = typename EnableIfConvertible<T>::type>
@@ -103,11 +100,7 @@ class SmartPointer
103100 }
104101
105102 /* * Destructor */
106- ~SmartPointer ()
107- {
108- this ->UnRegister ();
109- m_Pointer = nullptr ;
110- }
103+ ~SmartPointer () { this ->UnRegister (); }
111104
112105 /* * Overload operator -> */
113106 ObjectType * operator ->() const noexcept { return m_Pointer; }
@@ -199,7 +192,7 @@ class SmartPointer
199192
200193private:
201194 /* * The pointer to the object referred to by this smart pointer. */
202- ObjectType * m_Pointer;
195+ ObjectType * m_Pointer{ nullptr } ;
203196
204197 template <typename T>
205198 friend class SmartPointer ;
You can’t perform that action at this time.
0 commit comments