diff options
-rw-r--r-- | include/base.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/base.h b/include/base.h index 624e2174f..3d05b15cd 100644 --- a/include/base.h +++ b/include/base.h @@ -88,13 +88,12 @@ class reference : public reference_base public: reference() : value(0) { } reference(T* v) : value(v) { if (value) inc(value); } - reference(const reference& v) : value(v.value) { if (value) inc(value); } - reference<T>& operator=(const reference<T>& other) + reference<T>& operator=(T* v) { - if (other.value) - inc(other.value); + if (v) + inc(v); this->reference::~reference(); - value = other.value; + value = v; return *this; } |