#include <iostream>
#include <boost/ptr_container/ptr_vector.hpp>
struct Base {
virtual void f() { std::cout << "Base\n"; }
virtual ~Base(){}
};
struct Derived : Base {
void f() { std::cout << "Derived\n"; }
};
int main()
{
boost::ptr_vector<Base> v;
v.push_back(new Derived);
v[0].f();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Ym9vc3QvcHRyX2NvbnRhaW5lci9wdHJfdmVjdG9yLmhwcD4Kc3RydWN0IEJhc2UgewogICAgdmlydHVhbCB2b2lkIGYoKSB7IHN0ZDo6Y291dCA8PCAiQmFzZVxuIjsgfQogICAgdmlydHVhbCB+QmFzZSgpe30KfTsKc3RydWN0IERlcml2ZWQgOiBCYXNlIHsKICAgIHZvaWQgZigpIHsgc3RkOjpjb3V0IDw8ICJEZXJpdmVkXG4iOyB9Cn07CmludCBtYWluKCkKewogICAgYm9vc3Q6OnB0cl92ZWN0b3I8QmFzZT4gdjsKICAgIHYucHVzaF9iYWNrKG5ldyBEZXJpdmVkKTsKICAgIHZbMF0uZigpOwp9Cg==