diff --git a/include/rcp.h b/include/rcp.h index f46b27b..5912a2a 100644 --- a/include/rcp.h +++ b/include/rcp.h @@ -276,21 +276,21 @@ rcp rcp_dynamic_cast(rcp && other) #define rcp_managed_root(classname) \ private: \ - mutable std::atomic ref_count{0}; \ + mutable std::atomic rcp_ref_count{0}; \ void rcp_inc() const \ { \ - ref_count.fetch_add(1, std::memory_order_relaxed); \ + rcp_ref_count.fetch_add(1, std::memory_order_relaxed); \ } \ void rcp_dec() const \ { \ - if (ref_count.fetch_sub(1, std::memory_order_acq_rel) == 1) \ + if (rcp_ref_count.fetch_sub(1, std::memory_order_acq_rel) == 1) \ { \ delete this; \ } \ } \ int rcp_count() const \ { \ - return ref_count.load(std::memory_order_relaxed); \ + return rcp_ref_count.load(std::memory_order_relaxed); \ } \ template friend class rcp; \ rcp_managed(classname)