Is there a reason this couldn't be extended to all auto returning functions?
Well, there's the fact that it wouldn't be possible unless the function was defined right there (not just a declaration). You'd lose the ability to forward declare such functions.
Also, functions don't return auto
. The auto
in front of a function definition is a purely syntactic thing to allow for trailing return types. And the only reason the return type is specified last is so that it can refer to the function's arguments (for template and decltype
work, usually). The functions still do return a specific value.