0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 23:44:01 +01:00

ircd::util: Add weak typedef util.

This commit is contained in:
Jason Volk 2016-09-11 15:14:41 -07:00
parent 59982cff43
commit a023048419

View file

@ -42,6 +42,13 @@ inline namespace util {
static constexpr NAME##_t NAME {};
#define IRCD_WEAK_TYPEDEF(TYPE, NAME) \
struct NAME \
:TYPE \
{ \
using TYPE::TYPE; \
};
#define IRCD_STRONG_TYPEDEF(TYPE, NAME) \
struct NAME \
{ \
@ -51,6 +58,8 @@ struct NAME \
operator TYPE &() { return val; } \
};
#define IRCD_WEAK_T(TYPE) \
IRCD_WEAK_TYPEDEF(TYPE, IRCD_UNIQUE(weak_t))
// ex: using foo_t = IRCD_STRONG_T(int)
#define IRCD_STRONG_T(TYPE) \