I have a c++ class T that I succesfully expose via:

class_<T, T*> ...


later on, I have

struct S {
  const T* underlying;
};

class_<S,S*>("S").
    .def_readonly("underlying", &S::underlying)
;

>From python, when I call:

s.underlying

where s is a python instance of S, i get the following error:

TypeError: No to_python (by-value) converter found for C++ type: T const*

Do I need another converter for T const* in particular? or for both T* and
T const*?
Does the class_<T,T*> above only expose T itself, not pointers to it?

Thanks
MM
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to