template<typename T> struct S {};
template<typename T> struct R {};
int main() {
typedef S<double> s1;
typedef S<int> s2;
typedef R<int> s3;
static_assert(xxx<s1, s2>::value,
"No, assertion must not be raised");
static_assert(xxx<s2, s3>::value,
"Yes, assertion must be raised");
}
所以,我想xxx<s1, s2>::value
返回true,而xxx<s2, s3>::value
期間編譯時返回false。獲取原始結構/類名
在C++中,xxx的存在是不可能的嗎? 或者,C++在理論上是否存在xxx,但可能沒有人做過它?
所以,'xxx :: value'是'true' iff'T'和'U'是同一個模板的特化版本嗎? –
Quentin
@Quentin:是的:) –