Hacker News new | ask | show | jobs
by MereInterest 1027 days ago
This is a stylistic difference, as there are some places where the leading return type is invalid, but a trailing return type using the -> is valid. For example, an immediately invoked lambda expression in which some of the returned values require type conversions.

For this reason, some prefer a “auto almost everywhere” style, in which you preferentially use trailing return types.