Variable length template arguments list?

后端 未结 4 1536
情话喂你
情话喂你 2021-02-01 10:03

I remember seing something like this being done:

template 
class X : public ListOfTypenames {};

that is, X inherits from

4条回答
  •  渐次进展
    2021-02-01 10:32

    Variable number of templates is part of the next C++ standard. However, you can get a taste of it if you're using GCC (from version 4.3). Here's a list of available C++0x features in GCC. You're looking for Variadic Templates.

    By the way, if you need a formal reference on how to achieve the inheritance mechanism as described by Earwicker, it's on the book C++ Templates.

提交回复
热议问题