MCPcopy Create free account
hub / github.com/pybind/pybind11 / isinstance_native_enum_impl

Function isinstance_native_enum_impl

include/pybind11/cast.h:144–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142
143template <typename T, detail::enable_if_t<std::is_enum<T>::value, int> = 0>
144bool isinstance_native_enum_impl(handle obj, const std::type_info &tp) {
145 handle native_enum = global_internals_native_enum_type_map_get_item(tp);
146 if (!native_enum) {
147 return false;
148 }
149 return isinstance(obj, native_enum);
150}
151
152template <typename T, detail::enable_if_t<!std::is_enum<T>::value, int> = 0>
153bool isinstance_native_enum_impl(handle, const std::type_info &) {

Callers

nothing calls this directly

Calls 2

isinstanceFunction · 0.85

Tested by

no test coverage detected