Groups
Sign in
Groups
boost_doc_translation
Conversations
About
Send feedback
Help
TypeError: No to_python (by-value) converter found for C++ type:
391 views
Skip to first unread message
tommy
unread,
Mar 13, 2012, 7:19:33 AM
3/13/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to boost_doc_translation
-----------------Relevant C++ code-----------------
struct my_struct
{
int i_;
bool operator==(my_struct const& m) const {return i_ == m.i_;}
};
BOOST_PYTHON_MODULE(pye)
{
class_<my_struct>("my_struct")
.def_readwrite("i", &my_struct::i_)
;
class_<std::vector<my_struct *> >("my_struct_vector")
.def(vector_indexing_suite<std::vector<my_struct *> >())
;
};
-----------------Relevant Python code-----------------
from pye import *
q = my_struct()
q.i = 3
my_vec = my_struct_vector()
my_vec.append(q)
len(my_vec)
print my_vec[0].i
for item in my_vec :
print item.i
Reply all
Reply to author
Forward
0 new messages