C++ C+中模板内的两种类型(单词?)+;

C++ C+中模板内的两种类型(单词?)+;,c++,llvm,C++,Llvm,在llvm代码中,我发现了以下代码示例: template <typename TagT, typename... MemberTs> class PointerSumType { uintptr_t Value; typedef detail::PointerSumTypeHelper<TagT, MemberTs...> HelperT; public: PointerSumType() : Value(0) {} /// A type

在llvm代码中,我发现了以下代码示例:

template <typename TagT, typename... MemberTs> class PointerSumType {
   uintptr_t Value;

   typedef detail::PointerSumTypeHelper<TagT, MemberTs...> HelperT;

 public:
   PointerSumType() : Value(0) {}

   /// A typed constructor for a specific tagged member of the sum type.
   template <TagT N>
   static PointerSumType
   create(typename HelperT::template Lookup<N>::PointerT Pointer) {
     PointerSumType Result;
     void *V = HelperT::template Lookup<N>::TraitsT::getAsVoidPointer(Pointer);
     assert((reinterpret_cast<uintptr_t>(V) & HelperT::TagMask) == 0 &&
            "Pointer is insufficiently aligned to store the discriminant!");
     Result.Value = reinterpret_cast<uintptr_t>(V) | N;
     return Result;
   }

   TagT getTag() const { return static_cast<TagT>(Value & HelperT::TagMask); }

   template <TagT N> bool is() const { return N == getTag(); }
  //.....
};
模板类指针sumtype{
uintptr_t值;
typedef detail::PointerSumTypeHelper HelperT;
公众:
PointerSumType():值(0){}
///sum类型的特定标记成员的类型化构造函数。
模板
静态指针sumtype
创建(typename HelperT::template Lookup::PointerT指针){
指针式结果;
void*V=HelperT::模板查找::TraitsT::getAsVoidPointer(指针);
断言((重新解释强制转换(V)&HelperT::TagMask)==0&&
“指针对齐不足,无法存储判别式!”);
结果.值=重新解释(V)| N;
返回结果;
}
TagT getTag()常量{return static_cast(Value&HelperT::TagMask);}
模板bool是()常量{return N==getTag();}
//.....
};
我的问题是:什么是
模板
,模板中怎么可能有两个单词

如果你能抽出时间回答我,谢谢


请注意,您可以在

找到此代码。好的,感谢您的评论,我明白了!我很傻:就像但这次的类型是TagT而不是int。这很混乱,因为模板的类型本身就是一个模板类型。。。但是好吧

模板
也是两个单词。怎么可能没有两个单词呢?它是非类型模板参数