is able to pass a array_t<py::object> or array_t<py::bytes> from python to c++? #4572
Unanswered
chinchilla-forest
asked this question in
Q&A
Replies: 1 comment
-
I know the python bytes can not be pod,but for a array.is it necessary to ask the type to be pod? just like c++ string is also not be pod. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
since i compile c++ code like this ,it will got the bytes or object is not the pod type. in numpy.h line 1420
void haha2(py::array_tpy::object& lt)
{
std::cout<<"hahahaha"<<std::endl;
}
error:
/third/pybind11/include/pybind11/numpy.h:1420:37: error: static assertion failed: Attempt to use a non-POD or unimplemented POD type as a numpy dtype
1420 | static_assert(is_pod_struct::value,
Beta Was this translation helpful? Give feedback.
All reactions