下面两种语法有区别吗:
template<int N> struct A; // (1)
和
template<const int N> struct A; // (2)
关于何时使用每种语法的任何一般准则?
最佳答案
没有。
§14.1 [temp.param] p5
[...] The top-level cv-qualifiers on the template-parameter are ignored when determining its type.
关于c++ - 模板参数中的 "T"和 "const T"有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65775669/