[Cython] wrapping c++

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Wed Mar 5 13:56:01 CET 2008


>
> If you declare the return type to be int* you simply have a problem...
Aw...sorry, hit the send combination while in the middle of typing!

What I meant to say is that it won't solve the problem - Cython will 
treat it as a pointer type. AFAIK the only way to assign to an lvalue in 
C is if you dereference it, ie

*lvalueReturningFunc() = rvalue;

But references have automatic dereferencing, so the syntax above can 
never work, and the needed syntax:

lvalueReturningFunc() = rvalue

is not legal C IIRC. So macros are the way to go.

-- 
Dag Sverre



More information about the Cython-dev mailing list