我知道我可以做功能模板template<int N> void f () {}
.
但是template<std::size_t N> void f() {}
呢? ?
最佳答案
typedef
只是给定类型的别名。所以任何整数类型的 typedef
本身就是一个整数类型。并且类型没有比 std::size_t
更完整。
关于C++ 非类型模板参数 : Is typedef of an integral type an integral type?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18406070/