#include<iostream>
using namespace std;
int main() {
int a, * p = &a;
decltype(a) t1;
decltype(p) t2;
//decltype(*p) t3; //*+decltype ==> int& ==> 需要初始化
//decltype((a)) t4; //()+decltype ==> int& ==> 需要初始值
remove_reference<decltype(*p)>::type t5; //int
add_pointer<decltype(p)> t6; //int *
return 0;
}
decltype、变量与指针
最新推荐文章于 2022-11-25 09:43:20 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)