本文介绍了模板模板参数参数名称的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在代码中

template < template<class TTP> class TP > ... // whatever

那么TTP可以在任何地方使用吗?在标准中找不到对这些名称发生的任何引用.

is TTP usable anywhere at all then? Can't find any reference to what happens with these names in the Standard.

推荐答案

[basic.scope.temp]/p1:

[basic.scope.temp]/p1:

它可以在列表中使用,仅此而已.例如,

It can be used inside that list, and that's it. For instance,

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;

这篇关于模板模板参数参数名称的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 11:00
查看更多