`dynamic_pointer_cast` without checking for `nullptr`