summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-17 22:54:57 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-17 22:54:57 +0000
commitddb47ba8ca88a45d473227bfd11d8199c9b30dd8 (patch)
tree27f66121efc7abaa19e40b088f9c984d0975e8ae /include/base.h
parent55c2a6f29af89105d2b9444226d60fc9c914dca7 (diff)
Revert "Remove duplicated function calls when using reference"
If these functions are removed, the C++ compiler generates them - badly. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11896 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/base.h b/include/base.h
index 3d05b15cd..624e2174f 100644
--- a/include/base.h
+++ b/include/base.h
@@ -88,12 +88,13 @@ class reference : public reference_base
public:
reference() : value(0) { }
reference(T* v) : value(v) { if (value) inc(value); }
- reference<T>& operator=(T* v)
+ reference(const reference& v) : value(v.value) { if (value) inc(value); }
+ reference<T>& operator=(const reference<T>& other)
{
- if (v)
- inc(v);
+ if (other.value)
+ inc(other.value);
this->reference::~reference();
- value = v;
+ value = other.value;
return *this;
}