What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
上一修订版两侧同时换到之后的修订记录
cs:programming:cpp:courses:cpp_basic_deep:chpt_2 [2024/04/16 15:05] – [decltype] codingharecs:programming:cpp:courses:cpp_basic_deep:chpt_2 [2024/04/16 15:06] – [decltype] codinghare
行 400: 行 400:
 ==decltype== ==decltype==
 decltype 获取一个表达式,并返回表达式的类型。decltype 与 auto 的区别在于,decltype **不会产生类型退化**。 decltype 获取一个表达式,并返回表达式的类型。decltype 与 auto 的区别在于,decltype **不会产生类型退化**。
- * decltype(val):''val'' 代表 entity(**变量名称**),那么 ''val'' 是什么类型,那么返回的就是什么类型+  
 +   * decltype(val):''val'' 代表 entity(**变量名称**),那么 ''val'' 是什么类型,那么返回的就是什么类型
 <code cpp> <code cpp>
 //x is an variable name //x is an variable name