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(); }
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); }
RefCounts *counts = 0;
public:
- WeakPtr() { }
+ WeakPtr() = default;
private:
WeakPtr(T *d, RefCounts *c): data(d), counts(d ? c : 0) { incref(); }