#include <iostream>
#include <vector>
#include <memory>
struct Base {
virtual void f() { std::cout << "Base\n"; }
virtual ~Base(){}
};
struct Derived : Base {
void f() { std::cout << "Derived\n"; }
};
int main()
{
std::vector<std::unique_ptr<Base>> v;
v.emplace_back(new Derived);
v[0]->f();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8bWVtb3J5PgpzdHJ1Y3QgQmFzZSB7CiAgICB2aXJ0dWFsIHZvaWQgZigpIHsgc3RkOjpjb3V0IDw8ICJCYXNlXG4iOyB9CiAgICB2aXJ0dWFsIH5CYXNlKCl7fQp9OwpzdHJ1Y3QgRGVyaXZlZCA6IEJhc2UgewogICAgdm9pZCBmKCkgeyBzdGQ6OmNvdXQgPDwgIkRlcml2ZWRcbiI7IH0KfTsKaW50IG1haW4oKQp7CiAgICBzdGQ6OnZlY3RvcjxzdGQ6OnVuaXF1ZV9wdHI8QmFzZT4+IHY7CiAgICB2LmVtcGxhY2VfYmFjayhuZXcgRGVyaXZlZCk7CiAgICB2WzBdLT5mKCk7Cn0K