#include <iostream>
#include <string>
struct S
{
S()
{
std::cout << "Constructed!" << std::endl;
}
S(const S&)
{
std::cout << "Copied!" << std::endl;
}
double d[10];
};
int main()
{
std::cout << "here we begin the show" << std::endl;
std::basic_string<S> s1;
std::cout << "lets resize" << std::endl;
s1.resize(5);
s1[2].d[2] = 1;
std::cout << "lets copy" << std::endl;
std::basic_string<S> s2(s1);
std::cout << "lets modify" << std::endl;
s2[2].d[2] = 3;
std::cout << "lets print" << std::endl;
std::cout << s1[2].d[2] << std::endl;
std::cout << s2[2].d[2] << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKc3RydWN0IFMKewogICAgUygpCiAgICB7ICAKICAgICAgICBzdGQ6OmNvdXQgPDwgIkNvbnN0cnVjdGVkISIgPDwgc3RkOjplbmRsOwogICAgfQoKICAgIFMoY29uc3QgUyYpCiAgICB7ICAKICAgICAgICBzdGQ6OmNvdXQgPDwgIkNvcGllZCEiIDw8IHN0ZDo6ZW5kbDsKICAgIH0KCiAgICBkb3VibGUgZFsxMF07Cn07CgppbnQgbWFpbigpCnsKICAgIHN0ZDo6Y291dCA8PCAiaGVyZSB3ZSBiZWdpbiB0aGUgc2hvdyIgPDwgc3RkOjplbmRsOwogICAgc3RkOjpiYXNpY19zdHJpbmc8Uz4gczE7CiAgICBzdGQ6OmNvdXQgPDwgImxldHMgcmVzaXplIiA8PCBzdGQ6OmVuZGw7CiAgICBzMS5yZXNpemUoNSk7CiAgICBzMVsyXS5kWzJdID0gMTsKICAgIHN0ZDo6Y291dCA8PCAibGV0cyBjb3B5IiA8PCBzdGQ6OmVuZGw7CiAgICBzdGQ6OmJhc2ljX3N0cmluZzxTPiBzMihzMSk7CiAgICBzdGQ6OmNvdXQgPDwgImxldHMgbW9kaWZ5IiA8PCBzdGQ6OmVuZGw7CiAgICBzMlsyXS5kWzJdID0gMzsKICAgIHN0ZDo6Y291dCA8PCAibGV0cyBwcmludCIgPDwgc3RkOjplbmRsOwogICAgc3RkOjpjb3V0IDw8IHMxWzJdLmRbMl0gPDwgc3RkOjplbmRsOwogICAgc3RkOjpjb3V0IDw8IHMyWzJdLmRbMl0gPDwgc3RkOjplbmRsOwp9Cg==