From: Nathan Binkert Date: Fri, 2 Apr 2010 18:20:32 +0000 (-0700) Subject: refcnt: no default copy contructor or copy operator X-Git-Tag: stable_2012_02_02~1432 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01dffaa32fb68981e7d8ff1a0beb96de7b892546;p=gem5.git 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. --- 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) {}