#include <string>
#include <iostream>
class A
{
public:
A() = default;
A(const A&) = default;
A(const std::string& str)
: m_str(str)
{
}
A(const A& rA, std::string str) : A(rA)
{
m_str += str;
}
const std::string& GetStr() const
{
return m_str;
}
private:
std::string m_str = "default value";
};
int main(int argc, char* argv[])
{
A a;
std::cout << a.GetStr() << std::endl;
A aa("aa");
std::cout << aa.GetStr() << std::endl;
A aaa(aa, "a-pops");
std::cout << aaa.GetStr() << std::endl;
return 0;
}
CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCmNsYXNzIEEKewogICBwdWJsaWM6CiAgICAgQSgpID0gZGVmYXVsdDsKICAgICBBKGNvbnN0IEEmKSA9IGRlZmF1bHQ7CgogICAgIEEoY29uc3Qgc3RkOjpzdHJpbmcmIHN0cikKICAgICAgIDogbV9zdHIoc3RyKQogICAgIHsKICAgICB9CiAgICAgQShjb25zdCBBJiByQSwgc3RkOjpzdHJpbmcgc3RyKSA6IEEockEpCiAgICAgewogICAgICAgIG1fc3RyICs9IHN0cjsKICAgICB9CgogICAgIGNvbnN0IHN0ZDo6c3RyaW5nJiBHZXRTdHIoKSBjb25zdAogICAgIHsKICAgICAgICAgcmV0dXJuIG1fc3RyOwogICAgIH0KICAgcHJpdmF0ZToKICAgICBzdGQ6OnN0cmluZyBtX3N0ciA9ICJkZWZhdWx0IHZhbHVlIjsKfTsKCgoKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIqIGFyZ3ZbXSkKewogICAgQSBhOwogICAgc3RkOjpjb3V0IDw8IGEuR2V0U3RyKCkgPDwgc3RkOjplbmRsOwoKICAgIEEgYWEoImFhIik7CiAgICBzdGQ6OmNvdXQgPDwgYWEuR2V0U3RyKCkgPDwgc3RkOjplbmRsOwoKICAgIEEgYWFhKGFhLCAiYS1wb3BzIik7CiAgICBzdGQ6OmNvdXQgPDwgYWFhLkdldFN0cigpIDw8IHN0ZDo6ZW5kbDsKCglyZXR1cm4gMDsKfQoK