C++ Language/Type/Shortcuts/FromReturnStatement
A compiler can infer a function's return type from its return
statement, by specifying the return type as either auto
or decltype(auto)
.
Additional information about inferring type from a return statement