PyBind11: boost::multiprecision::cpp_int to Python
问题 I am interested in using pybind11 to optimize some Python computation using C++. The casting documentation doesn't make much sense to me and was wondering if anyone knew how to cast boost datatypes, specifically cpp_int, to a Python datatype so I can return computations. A simple example of what I'm trying to do would be factorials: #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <boost/multiprecision/cpp_int.hpp> using boost::multiprecision::cpp_int; namespace py = pybind11