mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-30 11:41:30 +00:00
Add a scope guard call policy
```c++
m.def("foo", foo, py::call_guard<T>());
```
is equivalent to:
```c++
m.def("foo", [](args...) {
T scope_guard;
return foo(args...); // forwarded arguments
});
```
This commit is contained in:
@@ -28,6 +28,7 @@ endif()
|
||||
set(PYBIND11_TEST_FILES
|
||||
test_alias_initialization.cpp
|
||||
test_buffers.cpp
|
||||
test_call_policies.cpp
|
||||
test_callbacks.cpp
|
||||
test_chrono.cpp
|
||||
test_class_args.cpp
|
||||
@@ -40,7 +41,6 @@ set(PYBIND11_TEST_FILES
|
||||
test_exceptions.cpp
|
||||
test_inheritance.cpp
|
||||
test_issues.cpp
|
||||
test_keep_alive.cpp
|
||||
test_kwargs_and_defaults.cpp
|
||||
test_methods_and_attributes.cpp
|
||||
test_modules.cpp
|
||||
|
||||
Reference in New Issue
Block a user