Skip to content

Instantly share code, notes, and snippets.

@shaitan
Created January 23, 2014 09:49
Show Gist options
  • Save shaitan/8575821 to your computer and use it in GitHub Desktop.
Save shaitan/8575821 to your computer and use it in GitHub Desktop.
defines boost::python function which returns new object
#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