摘要: 优先级高的覆盖,同级发生冲突: using声明 = 自动变量 > using编译指令 = 全局 阅读全文
posted @ 2020-05-30 15:24 孱陵 阅读(336) 评论(0) 推荐(0) 编辑
摘要: auto h(int x, float y) -> double; // C++11后置返回类型 ->double被称为后置返回类型 auto是占位符(C++11新增用法) 结合decltype使用: template<class T1, class T2> auto gt(T1 x, T2 y) 阅读全文
posted @ 2020-05-30 13:49 孱陵 阅读(809) 评论(0) 推荐(0) 编辑
摘要: decltype (expression) var; // C++11 decltype是C++11新增的关键字 expression: 未用空号括起的标识符:var类型等于标识符类型 int a; decltype (a) var; // var type int 函数调用:var类型等于返回类型 阅读全文
posted @ 2020-05-30 10:46 孱陵 阅读(287) 评论(0) 推荐(0) 编辑