diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 5052f153a8..2d2b17ef9b 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -69,7 +69,7 @@ class type_caster_enum_type { if (native_enum) { return native_enum(static_cast(src)).release(); } - return type_caster_for_class_::cast( + return type_caster_base::cast( std::forward(src), // Fixes https://github.com/pybind/pybind11/pull/3643#issuecomment-1022987818: return_value_policy::copy, @@ -91,7 +91,7 @@ class type_caster_enum_type { return true; } if (!pybind11_enum_) { - pybind11_enum_.reset(new type_caster_for_class_()); + pybind11_enum_.reset(new type_caster_base()); } return pybind11_enum_->load(src, convert); } @@ -116,7 +116,7 @@ class type_caster_enum_type { } private: - std::unique_ptr> pybind11_enum_; + std::unique_ptr> pybind11_enum_; EnumType value; }; @@ -133,27 +133,6 @@ template class type_caster::value>> : public type_caster_enum_type {}; -template -struct type_uses_smart_holder_type_caster { - static constexpr bool value - = std::is_base_of>::value -#ifdef PYBIND11_USE_SMART_HOLDER_AS_DEFAULT - || type_uses_type_caster_enum_type::value -#endif - ; -}; - -template -struct type_caster_classh_enum_aware : type_caster {}; - -#ifdef PYBIND11_USE_SMART_HOLDER_AS_DEFAULT -template -struct type_caster_classh_enum_aware< - EnumType, - detail::enable_if_t::value>> - : type_caster_for_class_ {}; -#endif - template ::value, int> = 0> bool isinstance_native_enum_impl(handle obj, const std::type_info &tp) { handle native_enum = global_internals_native_enum_type_map_get_item(tp);