Created
January 23, 2014 09:49
-
-
Save shaitan/8575821 to your computer and use it in GitHub Desktop.
defines boost::python function which returns new object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/python/manage_new_object.hpp> | |
#include <boost/python/return_value_policy.hpp> | |
some_object* some_function() { | |
return new some_object(); | |
} | |
.def("some_function", some_function, boost::python::return_value_policy<boost::python::manage_new_object>(), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment