Generalized detail::runtime_class_helper