summaryrefslogtreecommitdiff
path: root/src/ref_ptr.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-08-04 11:38:04 +0700
committerMaxime Coste <mawww@kakoune.org>2017-08-04 11:38:04 +0700
commit45a7496f545bf7b10940bc55c27ddf018a1ffd17 (patch)
tree4f4ba6434083d518f5217f27006d15adeb4fa739 /src/ref_ptr.hh
parent420c6aca233e79249ffc8513347f73978eb0ecdc (diff)
Fix SafeCountable and RefCountable copy/move logic
The safe and ref counts should not get copied around.
Diffstat (limited to 'src/ref_ptr.hh')
-rw-r--r--src/ref_ptr.hh9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ref_ptr.hh b/src/ref_ptr.hh
index 5711ced2..0dbc0be7 100644
--- a/src/ref_ptr.hh
+++ b/src/ref_ptr.hh
@@ -8,8 +8,15 @@ namespace Kakoune
struct RefCountable
{
- int refcount = 0;
+ RefCountable() = default;
+ RefCountable(const RefCountable&) {}
+ RefCountable(RefCountable&&) {}
virtual ~RefCountable() = default;
+
+ RefCountable& operator=(const RefCountable&) { return *this; }
+ RefCountable& operator=(RefCountable&&) { return *this; }
+
+ int refcount = 0;
};
struct RefCountablePolicy