Jak*_*ght 3 c++ const auto c++11
我试图理解这段代码.我一直在想弄清楚为什么d以及e是int*和const int*.我可以使用一些帮助.
const int ci = i, &cr = ci;
auto b = ci; // b is an int (top-level const in ci is dropped)
auto c = cr; // c is an int (cr is an alias for ci whose const is top-level)
auto d = &i; // d is an int*(& of an int object is int*)
auto e = &ci; // e is const int*(& of a const object is low-level const)
Run Code Online (Sandbox Code Playgroud)