on Tue Jan 20 2009, Ricardo Abreu wrote:
> 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.
Looks like you want to
> 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 a;};,
> I just wanted to
Hello,
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 a;};, I just
wanted to ex
I'd define to/from Python conversions for the std::pair, mapping to
Python tuples, then use .add_property().
Alternatively, wrap std::pair the normal way via class_, then you
can use .def_readwrite().
You need to handle each std::pair combination of A,B separately,
like any other template class y