Add visibility attributes to rcp_managed()

This commit is contained in:
Josh Holtrop 2026-02-23 22:35:19 -05:00
parent eaad6ba6e0
commit 83ca3d8893
2 changed files with 14 additions and 15 deletions

View File

@ -113,6 +113,7 @@ public:
mutable std::atomic<int> ref_count{0}
#define rcp_managed(classname) \
public: \
rcp<classname> get_rcp() \
{ \
return rcp<classname>(this); \
@ -121,4 +122,5 @@ public:
static rcp<classname> create(Args&&... args) \
{ \
return (new classname(std::forward<Args>(args)...))->get_rcp(); \
}
} \
private:

View File

@ -9,6 +9,7 @@ static int myderived_destruct;
class MyBase
{
rcp_root();
rcp_managed(MyBase);
protected:
MyBase(int x, int y)
@ -20,13 +21,12 @@ protected:
{
mybase_destruct++;
}
public:
rcp_managed(MyBase);
};
class MyDerived : public MyBase
{
rcp_managed(MyDerived);
protected:
MyDerived(double v) : MyBase(1, 2)
{
@ -37,9 +37,6 @@ protected:
{
myderived_destruct++;
}
public:
rcp_managed(MyDerived)
};
void t1()