From 1c121b8a9a5f4916990adcd16070a0124b0e8fbe Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 7 Jan 2023 21:01:23 +0100 Subject: workflows/test: test building Boost.Python --- examples/python/hello.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/python/hello.cpp (limited to 'examples/python/hello.cpp') diff --git a/examples/python/hello.cpp b/examples/python/hello.cpp new file mode 100644 index 0000000..b7516e4 --- /dev/null +++ b/examples/python/hello.cpp @@ -0,0 +1,19 @@ +#include + +#include +using namespace boost::python; + +struct World +{ + void set(const std::string& msg) { this->msg = msg; } + std::string greet() const { return msg; } + std::string msg; +}; + +BOOST_PYTHON_MODULE(hello) +{ + class_("World") + .def("greet", &World::greet) + .def("set", &World::set) + ; +} -- cgit v1.2.3