The code below doesn't compile on GCC 11 with -std=c++17, but does with -std=c++20:
#include <iostream>
#include <string>
struct Foo {
std::string s;
int i;
};
int main()
{
Foo foo("hello", 42);
std::cout << foo.s << ' ' << foo.i << '\n';
}
What's the feature in C++20 that enables this? What kind of constructor is generated by the compiler?