Remove get_root_rcp()

This commit is contained in:
Josh Holtrop 2026-02-23 21:55:26 -05:00
parent b45e664726
commit 71b4bf14a0

View File

@ -100,9 +100,9 @@ class root
private: private:
mutable std::atomic<int> ref_count{0}; mutable std::atomic<int> ref_count{0};
protected:
mutable rcp<root> root_rcp; mutable rcp<root> root_rcp;
protected:
root() root()
{ {
root_rcp.init_ptr(this); root_rcp.init_ptr(this);
@ -124,18 +124,12 @@ public:
delete this; delete this;
} }
} }
rcp<root> & get_root_rcp()
{
return root_rcp;
}
}; };
#define rcp_managed(classname) \ #define rcp_managed(classname) \
rcp<classname> get_rcp() \ rcp<classname> get_rcp() \
{ \ { \
root * r = (root *)this; \ return rcp<classname>(root_rcp); \
return rcp<classname>(r->get_root_rcp()); \
} \ } \
template <typename... Args> \ template <typename... Args> \
static rcp<classname> create(Args&&... args) \ static rcp<classname> create(Args&&... args) \