3 ms·
G++ 5.2 complains: "new types may not be defined in a return type" An alternative in C++14: auto hello(int c) { struct { int a; int b; } result { c, c + 1
by gpderetta 11y ago
G++ 5.2 complains: "new types may not be defined in a return type"
An alternative in C++14:
auto hello(int c) {
struct { int a; int b; } result { c, c + 1 };
return result;
}
or with gcc extensions:
auto hello(int c) {
return (struct { int a; int b; }) { c, c + 1 };
}