Function declaration

Regular function declarator syntax vs Trailing return type declaration. - cppreference

// C or C++98
int f(int x, int y) {
    // ...
}
// C++11
auto f(int x, int y) -> int {
    // ...
}
// C++14
auto f(int x, int y) {
    // The return type is deduced automatically
    // based on the function's body.
    // ...
}
Written on February 23, 2023, Last update on February 23, 2023
c++-syntax