make sure smart_ptr can be used with polymorphism.