#include <iostream>
using namespace std;
struct foo
{
std::string &str;
foo(std::string &other) : str(other) {}
void operator()(std::string &some) const
{
str += some;
}
};
int main()
{
std::string ext("Hello");
foo a{ ext };
std::string more(" world!");
a(more);
cout << a.str;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKICAgIHN0cnVjdCBmb28KICAgIHsKICAgIAlzdGQ6OnN0cmluZyAmc3RyOwogICAgCWZvbyhzdGQ6OnN0cmluZyAmb3RoZXIpIDogc3RyKG90aGVyKSB7fQogICAgCiAgICAJdm9pZCBvcGVyYXRvcigpKHN0ZDo6c3RyaW5nICZzb21lKSBjb25zdAogICAgCXsKICAgIAkJc3RyICs9IHNvbWU7CiAgICAJfQogICAgfTsKICAgIAogICAgaW50IG1haW4oKQogICAgewogICAgCXN0ZDo6c3RyaW5nIGV4dCgiSGVsbG8iKTsKICAgIAlmb28gYXsgZXh0IH07CiAgICAKICAgICAgICBzdGQ6OnN0cmluZyBtb3JlKCIgd29ybGQhIik7CiAgICAJYShtb3JlKTsKICAgIAogICAgICAgIGNvdXQgPDwgYS5zdHI7CiAgICAJcmV0dXJuIDA7CiAgICB9