【发布时间】:2020-07-31 23:47:01
【问题描述】:
#include <type_traits>
int main()
{
int n;
auto* p1 = &n;
auto p2 = &n;
static_assert(std::is_same_v<decltype(p1), decltype(p2)>); // ok
}
auto* p = &n 和 auto p = &n 之间有什么区别?还是只是编码风格问题?
【问题讨论】:
-
风格,可读性。
标签: c++ c++11 syntax coding-style auto