summaryrefslogtreecommitdiff
path: root/include/base.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-09-12 16:56:47 -0400
committerAdam <Adam@anope.org>2012-09-12 16:56:47 -0400
commitc4a53990f0767b38f0c2454c9e10e4f85ad08093 (patch)
tree7fe217cd58a852db92d6007f3ff19473d5540b8a /include/base.h
parent3af395f6a1c4679ac30b7a06bf7890f598d68047 (diff)
Fix bug #291 - fix rehashing bind tags not changing them between servers/clients and ssl/nonssl
Diffstat (limited to 'include/base.h')
-rw-r--r--include/base.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/base.h b/include/base.h
index 45c60802c..230ed1db4 100644
--- a/include/base.h
+++ b/include/base.h
@@ -142,6 +142,21 @@ class CoreExport reference
if (value && value->refcount_dec())
delete value;
}
+
+ inline reference<T>& operator=(T* other)
+ {
+ if (value != other)
+ {
+ if (value && value->refcount_dec())
+ delete value;
+ value = other;
+ if (value)
+ value->refcount_inc();
+ }
+
+ return *this;
+ }
+
inline operator bool() const { return value; }
inline operator T*() const { return value; }
inline T* operator->() const { return value; }