I have a std::complex<float> and want to use pybind11 to convert that value into a temporary pybind11::object (storing a complex python value). How do I do this?
I have a std::complex<float> and want to use pybind11 to convert that value into a temporary pybind11::object (storing a complex python value). How do I do this?
Use pybind11::cast.
std::complex<float> a{1, 2};
pybind11::object obj = pybind11::cast(a);