wrapping a list of structs with boost.python
问题 I have a C++ function that returns a list of structs. Inside the struct, there are more lists of structs. struct CameraInfo { CamName name; std::list<CamImageFormat> lImgFormats; std::list<CamControls> lCamControls; }; std::list<CameraInfo> getCameraInfo() { std::list<CameraInfo> lCamerasInfo; // fill lCamerasInfo return lCamerasInfo; } then for exporting it I was using: class_<CameraNode....> >("CameraNode", no_init) ... ... .def("listCameraInfo", make_function(&CameraNode::listCameraInfo))