diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 537b217ef..2a419371d 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -169,7 +169,7 @@ inline detail::type_info *get_local_type_info(const std::type_index &tp) { auto &locals = registered_local_types_cpp(); auto it = locals.find(tp); if (it != locals.end()) - return (detail::type_info *) it->second; + return it->second; return nullptr; } @@ -177,7 +177,7 @@ inline detail::type_info *get_global_type_info(const std::type_index &tp) { auto &types = get_internals().registered_types_cpp; auto it = types.find(tp); if (it != types.end()) - return (detail::type_info *) it->second; + return it->second; return nullptr; } diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index f1881fa47..095c1888f 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -65,7 +65,7 @@ struct overload_hash { /// Whenever binary incompatible changes are made to this structure, /// `PYBIND11_INTERNALS_VERSION` must be incremented. struct internals { - type_map registered_types_cpp; // std::type_index -> type_info + type_map registered_types_cpp; // std::type_index -> pybind11's type information std::unordered_map> registered_types_py; // PyTypeObject* -> base type_info(s) std::unordered_multimap registered_instances; // void * -> instance* std::unordered_set, overload_hash> inactive_overload_cache; @@ -196,8 +196,8 @@ PYBIND11_NOINLINE inline internals &get_internals() { } /// Works like `internals.registered_types_cpp`, but for module-local registered types: -PYBIND11_NOINLINE inline type_map ®istered_local_types_cpp() { - static type_map locals{}; +PYBIND11_NOINLINE inline type_map ®istered_local_types_cpp() { + static type_map locals{}; return locals; }