C++11 decltype学习问题

来源:互联网 发布:大连淘宝网店装修 编辑:程序博客网 时间:2024/06/04 17:55
#include<iostream>using namespace std;int odd[] = { 1, 3, 5, 7, 9 };int even[] = { 0, 2, 4, 6, 8 };decltype(odd)*arrptr(int i){return (i % 2) ? &odd : &even;    //我觉得odd和even就已经是指针了,何必再取址?但是不加上&,编译器又会报错,说返回类型不一致。}
0 0
原创粉丝点击