Add visibility attributes to rcp_managed()
This commit is contained in:
parent
eaad6ba6e0
commit
83ca3d8893
@ -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:
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user