Avoid need for rcp_managed() call in rcp root class
This commit is contained in:
parent
83ca3d8893
commit
53b2247432
@ -96,7 +96,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define rcp_root() \
|
#define rcp_root(classname) \
|
||||||
public: \
|
public: \
|
||||||
void rcp_inc() const \
|
void rcp_inc() const \
|
||||||
{ \
|
{ \
|
||||||
@ -110,7 +110,8 @@ public:
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
private: \
|
private: \
|
||||||
mutable std::atomic<int> ref_count{0}
|
mutable std::atomic<int> ref_count{0}; \
|
||||||
|
rcp_managed(classname)
|
||||||
|
|
||||||
#define rcp_managed(classname) \
|
#define rcp_managed(classname) \
|
||||||
public: \
|
public: \
|
||||||
|
|||||||
@ -8,8 +8,7 @@ static int myderived_destruct;
|
|||||||
|
|
||||||
class MyBase
|
class MyBase
|
||||||
{
|
{
|
||||||
rcp_root();
|
rcp_root(MyBase);
|
||||||
rcp_managed(MyBase);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MyBase(int x, int y)
|
MyBase(int x, int y)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user