Why in Cython is possible to wrap
std::pair<int, Foo*> myPair;
but not
std::pair<Foo*,Bar*> myPair;
In particular, wrapping in Cython the std::pair
is done as follows:
pair[int, Foo*]
and works smoothly, but when the first element of is also a pointer I have problems:
pair[Foo*,Bar*] myPair2
I'm getting
pair[Foo*,Bar*] myPair2
^
------------------------------------------------------------
test.pyx:50:17: Expected an identifier or literal
I'm using Cython 0.17.1, g++ 4.4 on Linux
The types are treated the same in the pair
definition; it is probably a general limitation for the []
syntax. You could try to workaround it with a typedef: ctypedef Foo* Foo_pointer
Copy pasted from a comment by @J.F.Sebastian so that this question can be marked as answered (to hopefully clear up the list of unanswered questions -- it has been a month!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With