【发布时间】:2026-02-10 03:55:01
【问题描述】:
我正在学习 SFINAE(替换失败不是) 我在一个网站上找到了一个例子,
template<typename T>
class is_class {
typedef char yes[1];
typedef char no [2];
template<typename C> static yes& test(int C::*); // What is C::*?
template<typename C> static no& test(...);
public:
static bool const value = sizeof(test<T>(0)) == sizeof(yes);
};
我在第 5 行发现了一个新签名 int C::*。起初我以为是 operator*,但我想这不是真的。
请告诉我这是什么。
【问题讨论】:
-
很抱歉问了类似的问题。我试图用关键字“::*”搜索它,但我找不到它。感谢您让我知道类似问题的链接。
标签: c++