4 ms·
C++ ends up with three forms (of course it does): Normal C style declaration int foo() { return 2; } Trailing return type. Useful when the return type de
by KayEss 9y ago
C++ ends up with three forms (of course it does):
Normal C style declaration
int foo() { return 2; }
Trailing return type. Useful when the return type depends on the parameter types, or is inside the namespace of the function
auto foo() -> int { return 2; }
Automated type deduction. Increasingly the choice when possible
auto foo() { return 2; }