Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Type/Shortcuts/TrailingReturnType

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

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