misc.rst
9.15 KB
-
Add a scope guard call policy · 1ac19036
```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 }); ```Dean Moldovan committed