Advantage of using trailing return type in C++11 functions
问题 What is the advantage of specifying a trailing return type in C++11, as opposed to a normal return type? Look at foo1 vs foo2 here: int foo1() { return 1; } auto foo2() -> int { return 1; } int main() { foo1(); foo2(); } 回答1: In this example, they mean the exact same thing. However, there are a few advantages to using the trailing return type form consistently (Phil Nash calls these "East End Functions", since the return type is on the east end). Using parameters. Obviously when using