diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-08-04 11:38:04 +0700 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-08-04 11:38:04 +0700 |
| commit | 45a7496f545bf7b10940bc55c27ddf018a1ffd17 (patch) | |
| tree | 4f4ba6434083d518f5217f27006d15adeb4fa739 /src/ref_ptr.hh | |
| parent | 420c6aca233e79249ffc8513347f73978eb0ecdc (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.hh | 9 |
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 |
