C++ Language/Type/Shortcuts/TrailingReturnType

In templated code (using template-parameter T), if you want your compiler to infer a function's return type from an expression that involves a parameter's type, then use this "trailing return type" syntax: auto AddTwo(T x) -> decltype(x+2) { return x+2; }.

Additional information about the trailing return syntax