摘要:
constexpr、const 和 #define 的比较 一、定义常量 constexpr 定义:constexpr用于定义在编译期可求值的常量表达式。示例:constexpr int x = 5; 这里,x的值在编译期就确定为5。 const 定义:const表示变量在运行期间不能被修改,但不保 阅读全文
posted @ 2024-12-11 00:15 Further_Step 阅读(92) 评论(0) 推荐(0)
posted @ 2024-12-11 00:15 Further_Step 阅读(92) 评论(0) 推荐(0)
posted @ 2024-12-11 00:15 Further_Step 阅读(42) 评论(0) 推荐(0)