Unverified Commit 0fdad20a authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #720 from capnproto/harris/disallow-refcounted-copy

Disallow copy construction/assignment of (Atomic)Refcounted classes
parents 291f1d86 6bc4c7a6
......@@ -67,7 +67,9 @@ class Refcounted: private Disposer {
// Own<T> could also be nice.
public:
Refcounted() = default;
virtual ~Refcounted() noexcept(false);
KJ_DISALLOW_COPY(Refcounted);
inline bool isShared() const { return refcount > 1; }
// Check if there are multiple references to this object. This is sometimes useful for deciding
......@@ -127,7 +129,9 @@ Own<T> Refcounted::addRefInternal(T* object) {
class AtomicRefcounted: private kj::Disposer {
public:
AtomicRefcounted() = default;
virtual ~AtomicRefcounted() noexcept(false);
KJ_DISALLOW_COPY(AtomicRefcounted);
inline bool isShared() const {
#if _MSC_VER
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment