与普通返回类型相比,在C++ 11中指定尾随返回类型有什么好处?看看foo1vs foo2在这里:
foo1
foo2
int foo1() { return 1; } auto foo2() -> int { return 1; } int main() { foo1(); foo2(); }
c++ auto c++11 trailing-return-type
auto ×1
c++ ×1
c++11 ×1
trailing-return-type ×1