umbrello 2.34.70-5524f40e1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
cxx11-alternative-function-syntax.h
Go to the documentation of this file.
1// https://en.wikipedia.org/wiki/C%2B%2B11#Alternative_function_syntax
2
3// #1
4template<class Lhs, class Rhs>
5 auto adding_func(const Lhs &lhs, const Rhs &rhs) -> decltype(lhs+rhs) {return lhs + rhs;}
6
7// #2
8struct SomeStruct {
9 auto func_name(int x, int y) -> int;
10};
11
12auto SomeStruct::func_name(int x, int y) -> int {
13 return x + y;
14}
auto adding_func(const Lhs &lhs, const Rhs &rhs) -> decltype(lhs+rhs)
Definition: cxx11-alternative-function-syntax.h:5
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
int int y int
Definition: cxx11-lambda-functions-and-expressions.h:4
Definition: cxx11-alternative-function-syntax.h:8
auto func_name(int x, int y) -> int
Definition: cxx11-alternative-function-syntax.h:12