From 01dffaa32fb68981e7d8ff1a0beb96de7b892546 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 2 Apr 2010 11:20:32 -0700 Subject: refcnt: no default copy contructor or copy operator We shouldn't allow these because the default versions will copy the reference count which is definitely not what we want. --- src/base/refcnt.hh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/base') diff --git a/src/base/refcnt.hh b/src/base/refcnt.hh index d1663ad72..64224ca7f 100644 --- a/src/base/refcnt.hh +++ b/src/base/refcnt.hh @@ -37,7 +37,11 @@ class RefCounted int count; private: + // Don't allow a default copy constructor or copy operator on + // these objects because the default operation will copy the + // reference count as well and we certainly don't want that. RefCounted(const RefCounted &); + RefCounted &operator=(const RefCounted &); public: RefCounted() : count(0) {} -- cgit v1.2.3