gpt4 book ai didi

C++ 非类型模板参数 : Is typedef of an integral type an integral type?

转载 作者:行者123 更新时间:2023-11-28 00:42:03 25 4
gpt4 key购买 nike

我知道我可以做功能模板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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com