模板参数列表的模板参数是什么意思

5 c++ templates

有报道称3.3.9/1:

模板模板参数的模板参数名称的声明性区域是引入名称的最小模板参数列表.

你能举个例子来理解上面的定义吗?我也有兴趣了解模板参数的template-parameter-list是什么意思?一个例子会有所帮助.

Pot*_*ter 5

template< // outer template-parameter-list
    template< // inner template-parameter-list
        typename q, // named parameter of a template template-parameter
        q x // use that name
    > // the declarative region ends here
    class q // hence the name may be reused
> struct x {};
Run Code Online (Sandbox Code Playgroud)

如果这有助于跟进,那么它再次没有评论:

template< template< typename q, q x > class q >
struct x {};
Run Code Online (Sandbox Code Playgroud)

它是一个在模板上参数化的类,它采用给定类型的常量值.你可以举例说x< std::integral_constant >.