Code can become legal C ++ 20. That's why ...
One of the quirks of the legacy of the C declaration in C ++ is that multiple declarations can go on the same line.
int a, b, c;
As you know, you can add pointers and links to the mix, preserving the "base" type:
int a, *b, &c = x;
. f , int:
int a, b, c, f();
, :
struct S {
int a, b, c, f() { return 0; }
};
, , :
struct S {
int a, b, c, f(float x, double y) { return x + y; }
};
, auto, ++ 20 , , ++ 17.
GCC . :
#include <iostream>
struct S {
int a, b, c, f(auto x, auto y) { return x + y; }
};
int main()
{
S s;
std::cout << s.f(1.0, 2.0) << '\n';
}
, , , , , , i, j w , 0.
, , "" ++.