提交 6443fea5 编写于 作者: fengqikai1414's avatar fengqikai1414 提交者: zhangchaoltt

cyber: make DEFINE_TYPE_TRAITS more readale

上级 2bf79c1f
......@@ -32,15 +32,17 @@
#define DEFINE_TYPE_TRAIT(name, func) \
template <typename T> \
class name { \
private: \
struct name { \
template <typename Class> \
static char Test(decltype(&Class::func)*); \
static constexpr bool Test(decltype(&Class::func)*) { \
return true; \
} \
template <typename> \
static int Test(...); \
static constexpr bool Test(...) { \
return false; \
} \
\
public: \
static constexpr bool value = sizeof(Test<T>(nullptr)) == 1; \
static constexpr bool value = Test<T>(nullptr); \
}; \
\
template <typename T> \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册