[C++-sig] Exposing members of members

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Tue Jan 20 15:30:02 CET 2009


> Thank you very much for your answer, but what I really wanted was to> expose to Python just the first element of the pair and not the whole> pair, so that the fact that it is a pair in c++ would be transparent> to python. For instance, if I had struct A{std::pair<int,bool> a;};,
> I just wanted to expose a.first, as a simple int...

Do you want

  a_obj = A()
  a_obj.a.first
 
to give you the int in Python or

  a_obj.a
 
?


More information about the Cplusplus-sig mailing list