【发布时间】:2012-10-02 12:04:14
【问题描述】:
我在维基百科上找到了这个:
auto c = 0; // c has type int
auto d = c; // d has type int
decltype(c) e; // e has type int, the type of the entity named by c
decltype((c)) f = c; // f has type int&, because (c) is an lvalue
使用 ideone 编译器(C++0x idk 他们使用什么)和 typeinfo 我无法看到 e 和 f 之间的差异。显然,我可能失败了,所以我想知道这是否是最终的 C++11 标准行为。
【问题讨论】: