1 2 3 4 5 6 7 8 9 10 11
#include <pybind11/pybind11.h> namespace py = pybind11; PYBIND11_MODULE(example, m) { py::class_<Pet>(m, "Pet") .def(py::init<const std::string&>()) .def("setName_T", &Pet::setName) .def("getName", &Pet::getName); } auto three()->int { return 3; }