Skip to content

Instantly share code, notes, and snippets.

@calvinchengx
Created January 4, 2013 03:56
Show Gist options
  • Select an option

  • Save calvinchengx/4449776 to your computer and use it in GitHub Desktop.

Select an option

Save calvinchengx/4449776 to your computer and use it in GitHub Desktop.
#include <string>
struct World
{
void set(std::string msg) { mMsg = msg; }
std::string greet() { return mMsg; }
std::string mMsg;
};
#include <boost/python.hpp>
using namespace boost::python;
BOOST_PYTHON_MODULE(classes)
{
class_<World>("World")
.def("greet", &World::greet)
.def("set", &World::set)
;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment