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:
parent
141f61d83a
commit
01dffaa32f
1 changed files with 4 additions and 0 deletions
|
@ -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) {}
|
||||
|
|
Loading…
Reference in a new issue