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

two types (words?) inside a template in C++

在 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(); }
  //.....
};

我的问题是:template <TagT N> 是什么意思,一个模板中怎么可能有两个词?

感谢您花时间回答我。

P.S。您可以在 http://llvm.org/docs/doxygen/html/PointerSumType_8h_source.html

找到此代码

OK,多谢评论,明白了!我很傻:就像,但这次类型是 TagT 而不是 int。这很令人困惑,因为模板的类型本身就是模板类型......但是没关系!