// Type your code here, or load an example.
#include <map>
#include <string>
#include <iostream>
struct Example : std::string {
Example() : Example("empty str") { }
template <typename T>
Example(T&& v) : std::string(std::forward<T>(v)) {
std::cout << "allocated: " << *this << std::endl;
};
Example(const Example&) = default;
Example& operator=(const Example&) = default;
Example(Example&&) = default;
Example& operator=(Example&&) = default;
~Example() {
std::cout << "deallocated: " << *this << std::endl;
}
};
int main () {
std::map<Example, Example> test;
test["example"] = std::string("Something");
}
Ly8gVHlwZSB5b3VyIGNvZGUgaGVyZSwgb3IgbG9hZCBhbiBleGFtcGxlLgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8aW9zdHJlYW0+CgpzdHJ1Y3QgRXhhbXBsZSA6IHN0ZDo6c3RyaW5nIHsKICAgIEV4YW1wbGUoKSA6IEV4YW1wbGUoImVtcHR5IHN0ciIpIHsgfQoKICAgIHRlbXBsYXRlIDx0eXBlbmFtZSBUPgogICAgRXhhbXBsZShUJiYgdikgOiBzdGQ6OnN0cmluZyhzdGQ6OmZvcndhcmQ8VD4odikpIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgImFsbG9jYXRlZDogIiA8PCAqdGhpcyA8PCBzdGQ6OmVuZGw7CiAgICB9OwoKICAgIEV4YW1wbGUoY29uc3QgRXhhbXBsZSYpID0gZGVmYXVsdDsKICAgIEV4YW1wbGUmIG9wZXJhdG9yPShjb25zdCBFeGFtcGxlJikgPSBkZWZhdWx0OwoKICAgIEV4YW1wbGUoRXhhbXBsZSYmKSA9IGRlZmF1bHQ7CiAgICBFeGFtcGxlJiBvcGVyYXRvcj0oRXhhbXBsZSYmKSA9IGRlZmF1bHQ7CgogICAgfkV4YW1wbGUoKSB7CiAgICAgICAgc3RkOjpjb3V0IDw8ICJkZWFsbG9jYXRlZDogIiA8PCAqdGhpcyA8PCBzdGQ6OmVuZGw7CiAgICB9Cn07CgppbnQgbWFpbiAoKSB7CiAgICBzdGQ6Om1hcDxFeGFtcGxlLCBFeGFtcGxlPiB0ZXN0OwogICAgdGVzdFsiZXhhbXBsZSJdID0gc3RkOjpzdHJpbmcoIlNvbWV0aGluZyIpOwp9