I would think that .def_readwrite would do what you need. If it doesn't
look at using .def_property and get/set pair. Caveat: making sure that
'a' stays a valid reference is your problem. Python will happily crash
horribly (if you are lucky) in response to bogus pointers or references.
Thanks for your fast answer! I tried it with following code:

class_<Foo>("Foo", init<>())
   .def_readwrite("a", &Foo::a)
   ;

But it raises the error:

error: cannot create pointer to reference member 'Foo::a'

And it seems it's really not possible to create a pointer to a reference in c++ ;) So what 
else do I have to write instead of "&Foo::a"?

Cheers,
Sebastian

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

Reply via email to