77#include < boost/python/returning.hpp>
88#include < boost/python/class.hpp>
99#include < boost/ref.hpp>
10+ #include < boost/python/ptr.hpp>
1011
1112using namespace boost ::python;
1213
@@ -42,9 +43,24 @@ X apply_X_X(PyObject* f, X x)
4243 return returning<X>::call (f, x);
4344}
4445
45- void apply_void_X_ref (PyObject* f, X x)
46+ void apply_void_X_ref (PyObject* f, X& x)
4647{
47- returning<X>::call (f, boost::ref (x));
48+ returning<void >::call (f, boost::ref (x));
49+ }
50+
51+ void apply_void_X_cref (PyObject* f, X const & x)
52+ {
53+ returning<void >::call (f, boost::cref (x));
54+ }
55+
56+ void apply_void_X_ptr (PyObject* f, X* x)
57+ {
58+ returning<void >::call (f, ptr (x));
59+ }
60+
61+ void apply_void_X_deep_ptr (PyObject* f, X* x)
62+ {
63+ returning<void >::call (f, x);
4864}
4965
5066int X::counter;
@@ -56,6 +72,9 @@ BOOST_PYTHON_MODULE_INIT(callbacks_ext)
5672 .def (" apply_void_int" , apply_void_int)
5773 .def (" apply_X_X" , apply_X_X)
5874 .def (" apply_void_X_ref" , apply_void_X_ref)
75+ .def (" apply_void_X_cref" , apply_void_X_cref)
76+ .def (" apply_void_X_ptr" , apply_void_X_ptr)
77+ .def (" apply_void_X_deep_ptr" , apply_void_X_deep_ptr)
5978 .add (
6079 class_<X>(" X" )
6180 .def_init (args<int >())
@@ -67,5 +86,4 @@ BOOST_PYTHON_MODULE_INIT(callbacks_ext)
6786 ;
6887}
6988
70-
71-
89+ #include " module_tail.cpp"
0 commit comments