diff --git a/system/jlib/jscm.hpp b/system/jlib/jscm.hpp index 263d9b6f069..3af562a0439 100644 --- a/system/jlib/jscm.hpp +++ b/system/jlib/jscm.hpp @@ -55,7 +55,7 @@ template inline void Release(X * ptr) { if (ptr) ptr->Release(); } template class Shared { public: - inline Shared() { ptr = NULL; } + constexpr inline Shared() = default; inline Shared(CLASS * _ptr, bool owned) { ptr = _ptr; if (!owned && _ptr) _ptr->Link(); } inline Shared(const Shared & other) { ptr = other.getLink(); } #if defined(__cplusplus) && __cplusplus >= 201100 @@ -107,7 +107,7 @@ template class Shared inline Shared & operator = (const CLASS * other); private: - CLASS * ptr; + CLASS * ptr = nullptr; }; @@ -115,7 +115,7 @@ template class Shared template class Owned : public Shared { public: - inline Owned() { } + constexpr inline Owned() = default; inline Owned(CLASS * _ptr) : Shared(_ptr) { } inline Shared & operator = (const Shared & other) { this->set(other.get()); return *this; } @@ -130,7 +130,7 @@ template class Owned : public Shared template class Linked : public Shared { public: - inline Linked() { } + constexpr inline Linked() = default; inline Linked(CLASS * _ptr) : Shared(LINK(_ptr)) { } inline Linked(const Shared & other) : Shared(other) { }