X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Frefptr.h;h=70cb17607361364de990f8828643f80af8d8da00;hb=8e1db641bb244980bc96ee9da4ba2f0dee8274ad;hp=6285d0ef4031e2e1bc29a1a0495b3e67bc5721dc;hpb=122846f0881673770d88eff7d925ecf25c01b62e;p=libs%2Fcore.git diff --git a/source/core/refptr.h b/source/core/refptr.h index 6285d0e..70cb176 100644 --- a/source/core/refptr.h +++ b/source/core/refptr.h @@ -35,7 +35,7 @@ private: RefCounts *counts = 0; public: - RefPtr() { } + RefPtr() = default; RefPtr(T *d): data(d), counts(data ? new RefCounts : 0) { incref(); } private: RefPtr(T *d, RefCounts *c): data(d), counts(d ? c : 0) { incref(); } @@ -81,7 +81,7 @@ public: T *get() const { return data; } T &operator*() const { return *data; } T *operator->() const { return data; } - operator bool() const { return data!=0; } + explicit operator bool() const { return data!=0; } unsigned refcount() const { return (data ? counts->count : 0); } @@ -106,7 +106,7 @@ private: RefCounts *counts = 0; public: - WeakPtr() { } + WeakPtr() = default; private: WeakPtr(T *d, RefCounts *c): data(d), counts(d ? c : 0) { incref(); }