int i=0; const int ci=i; auto b=ci; //(1) int *p=&i; decltype(*p) c=i;//(2)
以上(1)(2)中变量b,c类型为()
//⑧auto不能自动推导成CV-qualifiers(constant & volatile qualifiers),除非被声明为引用类型 const int i = 99; auto j = i; // j is int, rather than const int j = 100 // Fine. As j is not constant // Now let us try to have reference auto& k = i; // Now k is const int& k = 100; // Error. k is constant // Similarly with volatile qualifer
转载自:http://blog.csdn.net/huang_xw/article/details/8760403