在代码中
template < template<class TTP> class TP > ... // whatever
TTP
在任何地方都可用吗?在标准中找不到关于这些名称所发生情况的任何引用。
最佳答案
[basic.scope.temp]/p1:
The declarative region of the name of a template parameter of a template template-parameter is the smallest template-parameter-list in which the name was introduced.
它可以在该列表中使用,仅此而已。例如,
template < template<class T, T t> class TP > class foo {};
// ^ ^-----T's scope ends here
// |
// T can be used here
foo<std::integral_constant> bar;
关于c++ - 模板模板参数参数名称用法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28526061/