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.
This commit is contained in:
Nathan Binkert 2010-04-02 11:20:32 -07:00
parent 141f61d83a
commit 01dffaa32f

View file

@ -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) {}