33 py::class_<VirtClass, PyVirtClass>(
m,
"VirtClass")
38 m.def(
"test_callback_py_obj",
40 m.def(
"test_callback_std_func",
41 [](
const std::function<
void()> &func) {
func(); });
42 m.def(
"test_callback_virtual_func",
44 m.def(
"test_callback_pure_virtual_func",
46 m.def(
"test_cross_module_gil",
48 auto cm = py::module::import(
"cross_module_gil_utils");
49 auto gil_acquire =
reinterpret_cast<void (*)()
>(
50 PyLong_AsVoidPtr(
cm.attr(
"gil_acquire_funcaddr").ptr()));
51 py::gil_scoped_release gil_release;
TEST_SUBMODULE(gil_scoped, m)
void virtual_func() override
void pure_virtual_func() override
#define PYBIND11_OVERRIDE(ret_type, cname, fn,...)
virtual ~VirtClass()=default
#define PYBIND11_OVERRIDE_PURE(ret_type, cname, fn,...)
virtual void pure_virtual_func()=0
virtual void virtual_func()